All calculations that use floating point numbers may have precision errors, and if you reuse the results, then these exact erros add up. One thing to learn from this is to never use float as a loop control variable.
Use something like
for (my $tmp=2; $tmp<=20; tmp++) {
print $tmp/20.0, "\n";
}
. ($a, $b)
if (abs($a - $b) < 0.000001)
- , - , , , .