Good day everyone.
PHP version 5.6.37
There is such a code
$n = ceil(99 * ((10 / 100) * (10 / 100))); in the course of calculations we get just 1
but ceil rounds it to 2
I understand that the type obtained during the calculations is double and it is possible that this bug is related to this, but for example such a code
$n = ceil((double)1.00); or such
$n = ceil(100 * 0.01); works as expected and returns 1.
If any ideas why this happens? And how can this be fixed?
echo ceil(99 * ((10 / 100) * (10 / 100)))10/100echo ceil(99 * ((10 / 100) * (10 / 100)))10/100echo ceil(99 * ((10 / 100) * (10 / 100)))displays exactly 1 - andreymal