[Python-Dev] Revised decimal type PEP

M.-A. Lemburg mal@lemburg.com
Wed, 01 Aug 2001 09:50:48 +0200

Aahz Maruch wrote:
> Greg Ewing wrote:
> > aahz@rahul.net (Aahz Maruch):
> >>
> >> Truncation (rounding), overflow, and underflow errors can
> >> occur under addition, subtraction, and multiplication.  It's trivial to
> >> set them to be unbounded, but then Cowlishaw provides no mechanism for
> >> determining the truncation of division.
> >
> > If you allow for the representation of repeating parts in your
> > unbounded decimals, they could be closed under division. (I think --
> > does the division of one repeating decimal by another always lead to
> > a third repeating decimal?  Yes, it must, because every rational can
> > be expressed as a repeating decimal and vice versa, IIRC. Hmmm, that
> > means we'd just be implementing rationals another way...)
> <shudder>  Tell ya what, *you* write the algorithm and I'll think about
> it sometime in the next five years.  ;-)

Decimals are just a different way of displaying Rationals and
depending on their preset precision show a different behaviour
in numeric operations.

Marc-Andre Lemburg
CEO eGenix.com Software GmbH
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/