This is the case, in the company has a customer response will be one less into a number, probably similar to Baidu Encyclopedia
<?php$str=41.23*5000;echo Floor ($STR), echo "<br>", Echo intval ($STR);? > should get 206150, why is he getting 206149?
Workaround:
You can use Strval to turn around.
Reason:
This is an internal problem. The calculation of floating-point numbers is never completely accurate, for example, 1/3 means 0.333333 ... after n 3, but the calculation always omits the subsequent 3, which causes these phenomena such as echo "<br>". Intval ( (0.1+0.7) *10)//0.7echo "<br>". Intval (Strval (0.1+0.7) *10);//0.8 I am 32 for the system, the result is this, but 64 is not clear, the floating-point number in different systems, the accuracy is not the same, The results may not be the same. You can use Strval to turn your operation looks like 206150, in fact, the internal computer is 206149.99999 ... In the form of a floor operation, and that's what happens when you use the floor.