Decimal (was Re: Comment on PEP-0238)

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


In article <xJd07.953$c7.228697 at news1.rdc2.pa.home.com>,
Terry Reedy <tjreedy at home.com> wrote:
>
>I believe something like this is part of the IBM decimal arithmetic
>proposal/project.
>
>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 pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
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