Home >Backend Development >PHP Tutorial >这是什么成效

这是什么成效

WBOY
WBOYOriginal
2016-06-13 10:45:29858browse

这是什么效果?
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?

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

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