Possible Duplicate:
PHP unexpected result of float to int type cast
int((0.1+0.7)*10) = 7 in several languages. How to prevent this?
Can someone explain me this???
<?php
echo (int) ((0.1 + 0.7)*10);//displays an output: `7`
?>
I was expecting to see 8
but I got 7
- please explain this behavior.
Is this a special feature from PHP
? Or I didn't understand the integer type in PHP
?
Thanks.