摘要:
如果我们编译运行下面这个程序会看到什么?publicclassTest {publicstaticvoidmain(Stringargs[]){System.out.println(0.05+0.01);System.out.println(1.0-0.42);System.out.println(4.015*100);System.out.println(123.3/100);}}你没有看错!结果确实是0.0600000000000000050.5800000000000001401.499999999999941.2329999999999999Java中的简单浮点数类型float和dou 阅读全文