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

WBOY
Release: 2016-06-13 11:28:10
Original
1100 people have browsed it

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


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

这PHP 是外星计算法吗?

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template