docs.python.org favicon

15. Floating-Point Arithmetic: Issues and Limitations — Python 3.14.7 documentation

6
公开标注数
6
参与人数
2026-07-18 09:46:52
首次 Whisper

本页的公开 Whisper

划选高亮2026-07-18 16:10:52
原文高亮摘录
there are no easy answers
Whisper 随想笔记
Yeah, but knowing that doesn't make debugging floats any less painful.
划选高亮2026-07-18 13:07:52
原文高亮摘录
0.1 cannot be represented exactly as a base 2 fraction
Whisper 随想笔记
Wait, but my calculator shows 0.1 fine, so why does Python have this problem? Seems like a bug.
划选高亮2026-07-18 12:58:52
原文高亮摘录
0.1 cannot be represented exactly as a base 2 fraction
Whisper 随想笔记
So that's why 0.1 + 0.2 is never exactly 0.3, it's kind of mind-blowing when you first get it.
划选高亮2026-07-18 10:04:52
原文高亮摘录
Unfortunately
Whisper 随想笔记
I learned this the hard way when my accounting calc broke.
划选高亮2026-07-18 09:55:52
原文高亮摘录
Unfortunately
Whisper 随想笔记
But like, does it really matter for most apps though?
划选高亮2026-07-18 09:46:52
原文高亮摘录
Unfortunately
Whisper 随想笔记
Yeah, 0.1 + 0.2 still hits me every time.

分享本页 Whisper

分享到 X
短链接
https://domwhisper.com/s/3eaf415c4252
嵌入代码
<iframe src="https://domwhisper.com/embed/3eaf415c4252" width="100%" height="480" style="border:0;border-radius:16px" loading="lazy"></iframe>

看看大家在 docs.python.org 上讨论了什么

安装 DomWhisper,浏览网页时实时查看 whisper,也可以加入讨论。

获取插件