[Python-Dev] Adventures with Decimal

Greg Ewing greg.ewing at canterbury.ac.nz
Sat May 21 11:20:38 CEST 2005


Raymond Hettinger wrote:

>>From the mists of Argentina, a Palidan set things right.  The literal
> 1.1 became representable and throughout the land the monster was
> believed to have been slain.

I don't understand. Isn't the monster going to pop
right back up again as soon as anyone does any
arithmetic with the number?

I don't see how you can regard what Decimal does
as "schoolbook arithmetic" unless the teacher is
reaching over your shoulder and blacking out any
excess digits after everything you do.

And if that's acceptable, I don't see how it
helps significantly to have just the very first
step -- turning the input into numbers -- be
exempt from this behaviour. If anything, people
are going to be even more confused. "But it
can obviously cope with 1.1000000000000000001,
so why does it give the wrong answer when I add
something to it?"

Greg



More information about the Python-Dev mailing list