(a+b)-b答案为什么不是12.3 而是12.29999999997 是小数点问题吗?
public class HelloWorld{
public static void main(String[] args) {
double a=12.3;
int b=24;
double sum=(a+b)-b;
System.out.println("两数之和为:"+sum);
}
}
public class HelloWorld{
public static void main(String[] args) {
double a=12.3;
int b=24;
double sum=(a+b)-b;
System.out.println("两数之和为:"+sum);
}
}
2021-06-15
举报