[Python-Dev] Revised decimal type PEP

Greg Ewing greg@cosc.canterbury.ac.nz
Wed, 01 Aug 2001 12:17:14 +1200 (NZST)


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...)

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+