Discuss / Python / 请教大神

请教大神

Topic source

do_reduce.py 里str2float这两个结果为什么会产生0000000000001?

print(str2float('0.1234'))

print(str2float('.1234'))

0.12340000000000001

0.12340000000000001

浮点值不是精确值, 会有波动


  • 1

Reply