[Python-Dev] PEP239 (Rational Numbers) Reference Implementation and new issues
Andrew Koenig
ark@research.att.com
03 Oct 2002 10:45:27 -0400
Christopher> For what it's worth, the current implementation is
Christopher> nothing this complicated. Like every other numeric
Christopher> operation, compares of rationals with floats coerce to
Christopher> floats. So as a result rational(x)==float(x) iff
Christopher> float(rational(x))==float(x).
Attractive as this strategy may be from an implementation viewpoint,
it means that comparisons do not have the order-relation properties
that algorithms such as sort expect.
A similar problem exists today for comparisons between float and long,
by the way.
--
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark