我在这里尝试使用四舍五入函数。有时从.5向下舍入,有时向上舍入。那么问题出在哪里呢?
源文件:
print("rounding up 0.5 is",round(.5))
print("rounding up 1.5 is",round(1.5))
print("rounding up 2.5 is",round(2.5))
print("rounding up 3.5 is",round(3.5))输出:
rounding up 0.5 is 0
rounding up 1.5 is 2
rounding up 2.5 is 2
rounding up 3.5 is 4发布于 2015-05-13 03:46:17
https://stackoverflow.com/questions/30200081
复制相似问题