Decimal arithmatic, was Re: Python GUI app to impress the boss?

Tim Peters tim_one at
Wed Oct 2 05:07:02 CEST 2002

[Chris Gonnerman]
> Whoops again... I didn't realize that the FixedPoint
> module actually IS using "banker's" rounding.

Yes, and rigorously so.

> Guess I should read the docs, eh?
> I second Tim Peter's motion... the rounding rule should
> be configurable on a per-application basis.

Then please help Doug do that, including *defining* the rounding disciplines
you think are needed; I was never able to bully <wink> those out of its
users, so "banker's rounding" is the only thing that's there (it happens to
be better for overall accuracy than biased "add a half and chop" rounding,
so I was keener to give casual users something less likely to get them into
trouble).  There are also difficult design decisions whenever a "global
magic setting" is involved, including thread safety and what to do if
different parts of an app need different settings (where "different parts"
can include 3rd-party library modules you're only dimly aware of, too -- you
can't step on what they need to happen, and neither can you allow them to
step on what you need).  I can't make time to help with this, other than to
point out such issues.

More information about the Python-list mailing list