Integer multiplication overflow.

Alex Martelli aleaxit at yahoo.com
Sun Oct 8 12:47:54 EDT 2000


"Fredrik Lundh" <effbot at telia.com> wrote in message
news:TUYD5.681$YU1.66035 at newsc.telia.net...
> Alex Martelli wrote:
> > It doesn't have unlimited-precision rationals in the language or
> > standard library (I don't know why -- it IS a strange omission)
>
> there's an implementation in the standard distribution:
>
>     Demo/classes/Rat.py

There does not seem to be such a file (nor, indeed, any Demo
directory) in the 2.0b2 distribution (Windows version).

Looking back a while, I was unable to find anything named rat*.py
in any standard distribution of 2.0, 1.6, or 1.5.2 either (again, the
for-Windows kinds).

Looking with google, I can see several references to demo/classes/rat.py
files on the web, under the filelists/manifests for various Python
distributions (not for Windows, and not as recent as 1.5.2 final, as far
as I can tell).


> if it's good enough (I cannot tell), and someone contributes some
> documentation, I'm sure it could be added to the standard library
> in 2.1.

I have not yet examined this Rat.py in depth (having not yet been
able to put my hands on it...), but another implementation worth
looking into is Lanny Ripple's yarn.py, which I was able to find under:
ftp://ftp.lip6.fr/pub/python/contrib-09-Dec-1999/DataStructures/yarn.tar.gz

No doubt there are others yet, since this module (from early '96) identifies
itself as "yet another" rational numbers module...


Alex






More information about the Python-list mailing list