
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. ;-) -- --- Aahz (@pobox.com) Hugs and backrubs -- I break Rule 6 <*> http://www.rahul.net/aahz/ Androgynous poly kinky vanilla queer het Pythonista I don't really mind a person having the last whine, but I do mind someone else having the last self-righteous whine.