我期望以下代码生成:" Both are equal",但我得到了" Both are NOT equal":
Both are equal
Both are NOT equal
float a=1.3f; double b=1.3; if(a==b) { System.out.println("Both are equal"); } else{ System.out.println("Both are NOT equal"); }
这是什么原因?
java math floating-point precision
floating-point ×1
java ×1
math ×1
precision ×1