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

Tim Peters tim.one at comcast.net
Wed Oct 2 14:39:18 EDT 2002


[Tim]
>> 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,

[Chris Gonnerman]
> I keep hearing this... what is the problem, exactly?

I think the replies (including two of your own <wink>) spoke more eloquently
to this point than I could.  The rules various commercial apps want are
utterly arbitrary by any rational criterion ("always round up", "round up
over 0.4", "round up over 0.7", "it depends on the *next* digit too", etc),
but that doesn't mean an arbitrary piece of code satisfies the requirements.
If I were still doing this, I expect I'd invent a way for users to plug in
their own "final rounding" function, and explicitly disown responsibility
for guessing what they want.





More information about the Python-list mailing list