1
class MagicWithOperators{
public static void main(String[] args) {
float f = 10.2F;
double d = 10.2;
System.out.println(f==d);
}
}
产量:false
。背后的原因是什么
为什么10.2f==10.2
是错误的,但10.0f==10.0
是真的?
http://stackoverflow.com/a/7392200/4028085 – brso05