<?php
echo 53.96-(44.98+8.98);
?>这段代码的输出是 7.105427357601E-15
在php5.25里的结果。请高手解释一下为什么?
echo 53.96-(44.98+8.98);
?>这段代码的输出是 7.105427357601E-15
在php5.25里的结果。请高手解释一下为什么?
解决方案 »
- 求助贴:如何将读取出来的信息变成图片
- 我在我的网站中发现了一个html文件,里面的内容是后门位置和密码,我想知道他是怎么进入我网站后台或服务器的,另外有什么方法可以解决这个问题?
- 各位老大,帮忙检查一下语法吧,关于引号的用法,难煞小弟!
- php编码问题
- 各位大虾请指教!
- 高手问题~~Up者有分(300分相送)
- 急急急急急,关于数据库丢失数据的问题
- 鉴于有人提问关于用户在线离线的问题,贡献我的段代码,希望对大家有帮助
- 谁可以PHP+MSSQL分页显示,而不用ODBC,这个我已经做出来了,我想知道还有谁知道的!
- 怎么才能知道当前项目是否安装的memcache
- 关于smart error的问题
- 在线等PHP<a href = ></a> 跳转画面传值 找不到指定画面的问题
echo (53.96-(44.98+8.98));
It is quite usual that simple decimal fractions like 0.1 or 0.7 cannot be converted into their internal binary counterparts without a little loss of precision. This can lead to confusing results: for example, floor((0.1+0.7)*10) will usually return 7 instead of the expected 8 as the result of the internal representation really being something like 7.9999999999.... This is related to the fact that it is impossible to exactly express some fractions in decimal notation with a finite number of digits. For instance, 1/3 in decimal form becomes 0.3333333. . .. So never trust floating number results to the last digit and never compare floating point numbers for equality. If you really need higher precision, you should use the arbitrary precision math functions or gmp functions instead.
不要信任浮点型数字的计算结果