Home  >  Article  >  Backend Development  >  PHP 小数的计算模式太坑爹了吧

PHP 小数的计算模式太坑爹了吧

WBOY
WBOYOriginal
2016-06-13 12:43:20729browse

PHP 小数的计算方式太坑爹了吧?
if(0.030 != (0.530-0.500+0+0))
{
   $s = 0.530-0.500+0+0;
   $s = 0.03 - $s;
}


这居然不相等??
相减后居然不是0 

这PHP 是外星计算法吗?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn