Why gmp is not in the standard library?

Christopher A. Craig list-python at ccraig.org
Thu Jan 15 10:02:34 EST 2004


miki.tebeka at zoran.com (Miki Tebeka) writes:

> Which made me think why Python don't use gmp as it's primary math
> package - we'll get fast results, a lot of number types and much more.
> 
> Can't think of any reason why Python is implementing its own long
> numbers...  Can you enlighten me?
> 

Originally I'm sure licensing was a concern, but portability is still
a huge concern.  I haven't tried to port gmp, but from what I've heard
it's an absolute nightmare.  Python's long type, on the other hand,
was (before kmul) essentially a textbook (a Knuth text book, to be specific)
implementation of multiprecision integers.  kmul takes a couple
shortcuts, especially in cases where the two numbers are of wildly
differing sizes, but is still pretty close to textbook.  As such
longobject.c should compile pretty much anywhere with anything
resembling ANSI C with no problems.

-- 
Christopher A. Craig <list-python at ccraig.org>
Perl is worse than Python because people wanted it worse -- Larry Wall





More information about the Python-list mailing list