>>> 99.95+0.01+0.03+0.01
Out: 100.00000000000001
有清楚原因的吗?来聊下
1
Duluku 2017-07-25 11:35:09 +08:00
|
2
matrixback 2017-07-25 11:37:51 +08:00
浮点数的运算,涉及到底层,每个语言都有个问题吧。
|
![]() |
3
ipwx 2017-07-25 11:42:11 +08:00
 你看,不损失精度的运算,也是很容易构造出来的。关键是你要明白,浮点数到底是什么…… |
![]() |
4
lixiangzaizheli 2017-07-25 11:44:31 +08:00
|