PEP239 (Rational Numbers) Reference Implementation and new issues

Erik Max Francis max at alcyone.com
Thu Oct 3 16:42:33 EDT 2002


Charles Krug wrote:

> If you're writing a rational class, I think it's perfectly reasonable
> in all
> cases to return a rational number, as well as to offer conversion
> operators
> into both float and q, r representations.

The problem is that the numerator and denominator can silently get huge,
resulting in progressively worse performance.  This is especially bad in
the case where this conversion is happening behind the scenes --
suddenly performance starts suffering and no code has changed.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ People say that life is the thing, but I prefer reading.
\__/ Logan Pearsall Smith
    Computer science / http://www.alcyone.com/max/reference/compsci/
 A computer science reference.



More information about the Python-list mailing list