Decimal (was Re: Comment on PEP-0238)

Aahz Maruch aahz at
Tue Jul 3 10:25:21 EDT 2001

In article <xJd07.953$c7.228697 at>,
Terry Reedy <tjreedy at> wrote:
>I believe something like this is part of the IBM decimal arithmetic
>1.0/3 = .3, 1.00/3 = .33, etc (in which case, 1/3 = 0 by the same rule)

That is incorrect.  The decimal arithmetic standard uses something
called a "context" to provide the information that an operation needs.
Among other things, the context specifies the precision, and unless you
explicitly change the context between operations, all three of the
examples you list above will provide the same result.
                      --- Aahz  <*>  (Copyright 2001 by aahz at

Hugs and backrubs -- I break Rule 6       
Androgynous poly kinky vanilla queer het Pythonista   

"I'm not tense, i'm just terribly, terribly alert"  --unknown

More information about the Python-list mailing list