0

为什么会在下面的代码中取整:

>>> round(0.49999999999999997)
0.0
>>> round(0.49999999999999998)
1.0
>>> round(1.4999999999999998)
1.0
>>> round(1.4999999999999999)
2.0

四舍五入0.499999999999999981.4999999999999999不是向下,为什么这种行为发生0.49999999999999998在小数点后一个 9 比 for 晚1.4999999999999998

4

0 回答 0