Decimal arithmetic, with example code
Robin Becker
robin at jessikat.fsnet.co.uk
Fri Oct 4 13:13:32 EDT 2002
In article <mailman.1033498683.13204.python-list at python.org>, Tim Peters
<tim.one at comcast.net> writes
>I don't see what this shows beyond that FixedPoint implements "banker's
>rounding" (round the infinitely precise result to the nearest retained
>digit, but in case of tie round to the nearest even number), while you seem
>to prefer "add a half and chop" rounding. No single rounding discipline is
>suitable for all commercial applications, and I hope the FixedPoint project
>finds a way to let users specify the rounding *their* app needs.
>Unfortunately, I was never able to find a FixedPoint user who was able to
>articulate the rounding rules they were trying to emulate <wink/sigh>.
The bankers and similar rounding schemes are intended to be fairer ie
some 0.5 cases are rounded down and others rounded up.
I seem to remember that digits are unevenly distributed (Benford's law?)
so does that affect the 'fairness' of assuming an equal number of even
and odd cases?
--
Robin Becker
More information about the Python-list
mailing list