A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-October/029105.html below:

[Python-Dev] PEP239 (Rational Numbers) Reference Implementation and new issues

[Python-Dev] PEP239 (Rational Numbers) Reference Implementation and new issues [Python-Dev] PEP239 (Rational Numbers) Reference Implementation and new issuesAndrew 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



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4