This question already has an answer here:
- Is floating point math broken? 29 answers
I'm issuing a strange behavior with intval in PHP 7.0
It seems like using
intval after a floating number computation returns wrong values.
Here's an example:
echo intval(920); // This prints 920 as expected echo intval(9.2 * 100); // this prints 919!!!
Probably I'm misunderstanding the correct usage of
Can someone explain me why this happens?