标签: python rounding-error
当我尝试运行print(round(x, 2))时,它显示为0.0。
print(round(x, 2))
答案 0 :(得分:1)
如果x小于0.005,它将舍入为0。
x = 0.005 round(x, 2) > 0.01 x = 0.0049 round(x, 2) > 0.00