Gary Herron gherron at
Thu Aug 7 18:20:32 CEST 2003

On Thursday 07 August 2003 07:30 am, Jean-Pierre Andreaux wrote:
> Gmpy module was a wrapper of the GNU MP library. It seems that no
> evolution is done on this module since 2001. Indeed, Gmpy is not
> supported in Python 2.2 nor 2.3.
> My question is the following: what is the better replacement solution
> for manipulating long numbers. I want to do long numbers
> exponentiations. Thanks in advance for your answers.
> JP

Python has (arbitrarily) long integer support built right in.  For instance:

>>> ((2**10)**10)**10

Notice the 'L' on the end of the result implies the value is a "long'
integer, not a 32-bit integer.  

In recent versions of Python, arithmetic on normal integers will
convert to long integers when an overflow occurs.

Is this what you wanted?

Gary Herron

More information about the Python-list mailing list