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/029064.html below:

PEP239 (Rational Numbers) Reference Implementation and new issues

[Python-Dev] Re: PEP239 (Rational Numbers) Reference Implementation and new issues [Python-Dev] Re: PEP239 (Rational Numbers) Reference Implementation and new issuesAndrew Koenig ark@research.att.com
02 Oct 2002 21:17:30 -0400
By the way, has anyone considered the idea of making operations
on rationals faster by never storing any trailing zeroes in the
numerator or denominator?  Instead, strip them and store the
(signed) difference between the number of zeroes you've stripped
from the numerator and the number you've stripped from the denominator.

In other words, instead of storing (num, denom) and having the number
be the (exact) value of num/demon, store (num, denom, exp) and have the
number be the (exact) value of (2**exp)*num/denom.


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