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, $/);
In reply to Re^2: Rounding error?
by ikegami
in thread Rounding error?
by dracos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |