# PHP Version 5.2.9
$a = 0.6/0.1;
$b = $a % 5;
print "\$a=$a; \$b=$b\n";
# result:
# $a=6; $b=0 # One should expect $b = 1
$a = 0.6/0.1;
$a = round($a);
$b = $a % 5;
print "\$a=$a; \$b=$b\n";
# result:
# $a=6; $b=1 # result as expected
Why is the result $b=0 in the first case.
And why does the round()-function seems to solve the problem?