这是什么成效

WBOY
Release: 2016-06-13 10:45:29
Original
856 people have browsed it

这是什么效果?
1   2 $i = 1/3;
  3 echo $i;
  4 echo '
';
  5 echo $i*3;
  6 echo '
';
  7 echo 0.333333333333*3;
  8 ?>


输出:

0.333333333333
1
0.999999999999

既然$i是0.333333333333 那么他乘以3就应该是0.999999999999 为何是1?

------解决方案--------------------
呵呵,无限循环小数都忘了

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