in reply to sprintf rounding convention
"Normal rounding" is a misleading term. As far as I know (and I can't be bothered to look it up) sprintf rounding uses whatever rounding libc uses, which tends but isn't guaranteed to be "banker's rounding". Banker's rounding, or HALF_EVEN in Java parlance*, is useful because it tends to lead to less distortion over large sums while still being predictable.
* HALF_EVEN is also the strategy Java uses for float and double maths.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: sprintf rounding convention
by ikegami (Patriarch) on Oct 30, 2009 at 22:04 UTC | |
by Joost (Canon) on Oct 30, 2009 at 23:01 UTC | |
by merlyn (Sage) on Oct 31, 2009 at 00:31 UTC | |
by Joost (Canon) on Oct 31, 2009 at 12:33 UTC | |
by kennethk (Abbot) on Oct 30, 2009 at 22:24 UTC | |
by Joost (Canon) on Oct 30, 2009 at 23:14 UTC | |
by ikegami (Patriarch) on Oct 31, 2009 at 01:48 UTC |
In Section
Seekers of Perl Wisdom