Use of GMPY

Alex Martelli aleax at aleax.it
Tue Sep 4 10:44:40 EDT 2001


"Paul Rubin" <phr-n2001 at nightsong.com> wrote in message
news:7xae0c86iy.fsf at ruckus.brouhaha.com...
> Alex, what's the difference between GPMY and the standard GMP module?

According to AMK (GMP's maintainer, I believe), "The GMPY module is
actively maintained and supports more of GMP's features, such as
multi-precision floats and rationals" (see the GMP page at
http://www.amk.ca/python/code/gmp.html).  Now I've been a bit
lazy about the "actively maintained" part, basically because the
next major step is writing the docs in a more Pythonic format and
I didn't have good access to Unix-y systems until recently, but
that's getting better, and 2.2 has features I'll want to support
in GMPY if I can find out how (e.g., long/int transparency), so
I expect I'll get a round tuit at some time during the fall.

The most significant extras of GMPY wrt GMP from my personal use
viewpoint are extra integer functions, actually - fast computation
of binomial coefficients ("combinations"), fast pseudo-random number
generation (not very important if you use /dev/random, of course,
but one doesn't get that on Windows:-), that sort of thing.  Oh,
there's also the little fact that GMPY comes in a Windows binary
version that's statically linked with a good GMP port (which was
quite important to me back when I only used Windows boxes:-), and
the fact that GMPY exposes a C-callable API.

I also tried to make GMPY suitable as a basis for Pearu
Peterson's symbolic-maths Python package, and enjoyed a
lot of support and advice from him, although I'm unsure
about the present state of the project -- I got sidetracked
by other things and for the moment suspended my intended
uses of symbolic maths, so I lost track of that project's
current status.


Alex






More information about the Python-list mailing list