我做错了什么?
>>> round(2.5), round(0.25, 1), round(0.025, 2)
(3.0, 0.3, 0.03)
>>> round(4.5), round(0.45, 1), round(0.045, 2)
(5.0, 0.5, 0.04)
为什么0.025四舍五入为0.03(向上),但为0.045到0.04(向下)?
在OSX上使用Python2.7:
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin