So I've been doing some math trying to use this loop for my project and I cannot understand no matter how hard I try why does this loop run two times instead of one.
$currValue = 40.3;
$maxValue = 40.6;
while ($currValue < $maxValue) {
$maxValue = $maxValue - 0.3;
echo $maxValue . '<br>';
}
// Output:
// 40.3
// 40.0
I would be really grateful if somebody provided me with some sort of explanation on this and or a way to work around this. I hope this question isn't a duplicate, I didn't manage to find anything similliar.