double num = 0.3; System.out.println(num); System.out.println(num - 0.2); System.out.println(num - 0.2 == 0.1);
结果为
0.3 0.09999999999999998 false
时间: 2024-11-12 06:59:05
double num = 0.3; System.out.println(num); System.out.println(num - 0.2); System.out.println(num - 0.2 == 0.1);
结果为
0.3 0.09999999999999998 false