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

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

WBOY
Release: 2016-06-13 12:43:20
Original
793 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