in reply to Re^2: Is this odd behavior a floating point problem?
in thread Is this odd behavior a floating point problem?

... you start with non-zero ...

Not sure what you're talking about.

n times adding x to zero is mathematically (but not necessarily numerically) the same as n * x.

$ perl -le '$sum += 1 for 1..40; print $sum' 40

So where is the problem?  I think you overlooked that $sum is initially undef/zero.