0.4
你注意过了么?
此处的运算结果是false。
这个是ruby上给的解释。哈哈,见识了。
Float objects have plenty of precision and can approximate 0.1 very well,
but the fact that this number cannot be represented exactly leads to problems.
Consider the following simple Ruby expression:
0.4 - 0.3 == 0.1 # Evaluates to false in most implementations
Because of rounding error, the difference between the approximations of 0.4 and 0.3 is
not quite the same as the approximation of 0.1. This problem is not specific to Ruby: C,
Java,JavaScript, and all languages that use IEEE-754 floating-point numbers suffer
from it as well.
相关知识
0.4
0.5×0.8=0.4被网友嘲讽,为什么你会怀疑自己甚至还拿计算器算?
温湿度对家畜的影响
如何做好火燕鸟饲料
烟台顽皮宠物用品销售有限公司
鸟类中的『女尊男卑』现象
实验动物的营养需要特点与饲养标准
宠物的快乐度是怎样减的?
一种宠物笼门的制作方法
养鸟安利闲谈
原文链接: 0.4 https://www.mcbbbk.com/newsview535370.html
| 上一篇: 宠物小精灵手游常见问题都有哪些? | 下一篇: 运维必存的20个常见的故障排查、... |
推荐分享

- 1养玉米蛇的危害 33026
- 2原创 ... 10445
- 3猫咪声音翻译器 9487
- 4狗交配为什么会锁住?从狗狗生... 8961
- 5petpet generat... 7896
- 6我的狗老公李淑敏33——如何... 7839
- 7甜蜜的宠物我是看守专用宠物之... 6471
- 8中国境内禁养的十大鸟种,你知... 6355
- 9家养水獭多少钱一只正常 5760
- 10自制狗狗辅食:棉花面纱犬的美... 5754




