in reply to Math::BigFloat Rounding
All rounding functions take as a second parameter a rounding mode from one of the following: 'even', 'odd', '+inf', '-inf', 'zero' or 'trunc'
I would guess you'd want to use 'odd' or '+inf'.
Also note that always rounding "up" at .X5 (i.e. common rounding, or '+inf' for positive numbers) can cause statistical errors, so using 'odd' or 'even' is probably better, with the default of 'even' having the advantage of being the (or a) standard.
See http://en.wikipedia.org/wiki/Rounding
update: the wiki page also claims that using round-to-even (instead of round-to-odd) helps when the final result tends to near 0. That seems to make sense to me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Math::BigFloat Rounding
by BarMeister (Beadle) on May 23, 2007 at 00:46 UTC |