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我的狗老公李淑敏33——如何 5096
- 2南京宠物粮食薄荷饼宠物食品包 4363
- 3家养水獭多少钱一只正常 3825
- 4豆柴犬为什么不建议养?可爱的 3668
- 5自制狗狗辅食:棉花面纱犬的美 3615
- 6狗交配为什么会锁住?从狗狗生 3601
- 7广州哪里卖宠物猫狗的选择性多 3535
- 8湖南隆飞尔动物药业有限公司宠 3477
- 9黄金蟒的价格 3396
- 10益和 MATCHWELL 狗 3352