Decimal arithmetic, with example code

Tim Peters tim at zope.com
Fri Oct 4 13:53:14 EDT 2002


[Robin Becker]
> The bankers and similar rounding schemes are intended to be fairer ie
> some 0.5 cases are rounded down and others rounded up.

Right.

> I seem to remember that digits are unevenly distributed (Benford's law?)

In some cases, and when it does apply, Benford's Law applies to the
*leading* digit; but rounding has to do with the trailing digit:

    http://mathworld.wolfram.com/BenfordsLaw.html

> so does that affect the 'fairness' of assuming an equal number of even
> and odd cases?

Not in Benford's Law cases, no.  That doesn't mean no cases exist in which
bias could be introduced, but worry about that is a tail-wagging-the-dog
kind of thing.





More information about the Python-list mailing list