in reply to Weird precision issues in float addition

Well, you are acumulating rounding errors on every iteration.

Using a multiplication to calculate the current value from the beginning every time would probably improve the situation, though not solve it completely as 0.1 can not be represented as a floating point value.

for(my $i = 0; ; $i++) { my $v = $begin + $step * $i; last if $v > $end; print "$v\n"; }