yesterday I found some issue in my code, but I don't understand what wrong is with PHP Floor function. For some values Floor() is not rounding correctly integer values.
$prise = 550.05 * 100;
echo $prise; // 55005
echo "\nFloor: ";
echo floor(intval($prise));
echo " - ";
echo floor((int)($prise));
echo " - ";
echo floor($prise);
echo " - ";
echo floor(55005); // Floor: 55004 - 55004 - 55004 - 55005
echo "\nNumber format: ";
echo number_format($prise, 0, '.', ''); // Number format: 55005
As you can see, correct value should equal 55005. For unknown reasons, the function still rounds the not decimal value. Could someone explain to me how it works, or is it a PHP issue?
Example in online PHP sandbox: http://sandbox.onlinephpfunctions.com/code/55b1782e1f3799815d610777a3de1c2d297e24c8
Thanks in advance