in reply to Re: Rounding error?
in thread Rounding error?
I'm surprised by your comment, not by the output, seeing as that prints 2 and 3 for me.
ActivePerl 5.6.1
ActivePerl 5.8.0
If it did give 2 for both, I'd be asking: "Can someone explain the sense of a rounding where the following prints 19, not 20:"
$sum += sprintf("%.0f", $_/10) foreach (0..19); print($sum, $/);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Rounding error?
by bmann (Priest) on Oct 19, 2004 at 03:08 UTC |