
I always thought "when is 0.9 repeating equal to 1?" kind of a funny philosophical question about limits - turns out pyt
Jupyter Notebook 代码截图,连续用 int() 截断 9.9 到 9.999…,输出在 9 和 10 之间反复横跳,末尾 9 的个数决定结果,像在玩数字抽奖。
适合这些场景
- 程序员群里吐槽浮点数坑
- 解释 int 截断和四舍五入的区别
- 写代码被精度问题整懵时
来源网络 · 版权归原作者网络收集
- 许可证
- Web collected
- 来源
- programmerhumor.io
- 详细信息
- 484×452 · PNG
标签
写文章用得上?让 AI 帮你配
粘贴文章,表情包自动配到笑点上。