Hello
I'm confused with the behavior of the following code:
$t = 9.8;
$deltaT = 0.1;
while($t < 10)
{
$t = $t+ $deltaT;
echo $t.'<br />';
}
For $t = 9.8, it echos the correct result(the last number it echos is 10), but for $t smaller than 9.8, for example $t = 9.5, the last number it echos is 10.1.
why?!
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.