|
|
| Perl: the Markov chain saw | |
| PerlMonks |
Re^3: Is this odd behavior a floating point problem?by Eliya (Priest) |
| on Mar 24, 2012 at 01:09 UTC ( #961342=note: print w/ replies, xml ) | Need Help?? |
|
... 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.
So where is the problem? I think you overlooked that $sum is initially undef/zero.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||