Python Tricks 07:0.1 + 0.2 = ?

在二进制浮点中,0.1和0.2都不能精确表示

640?wx_fmt=png

具体为什么,可以点击阅读原文看这篇文章:Why 0.1 Does Not Exist In Floating-Point - Exploring Binary

往期推荐:

发布了34 篇原创文章 · 获赞 61 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/source_code13/article/details/100919995