Multiprecision arithmetic library question.

duncan smith buzzard at urubu.freeserve.co.uk
Thu Jun 19 09:10:09 EDT 2008


Michael Press wrote:
> In article <slrng5homp.ihm.mdw at metalzone.distorted.org.uk>,
>  Mark Wooding <mdw at distorted.org.uk> wrote:
> 
>> Michael Press <rubrum at pacbell.net> wrote:
>>
>>> I already compiled and installed the GNU multiprecision library
>>> on Mac OS X, and link to it in C programs. 
>>> How do I link to the library from Python? 
>> You know that Python already supports multiprecision integer arithmetic,
>> right?  If you desperately want GMP, though, there's the gmpy module
>> (q.g.).
> 
> No, I do not know that. Define desperate. 
> Does Python support the extended Euclidean algorithm
> and other number theory functions?
> How fast does Python multiply?
> Not that the latter is particularly important,
> as C is built for speed.
> 
> I've been fooling around. Ran dir(gmpy), and 
> it does not show the full complement of GMP
> library functions, such as the various division
> functions. e.g. mpz_tdiv_qr.
> 

There's also 
http://www.egenix.com/products/python/mxExperimental/mxNumber/.  I'm not 
sure how the functionality compares to GMPY.

Duncan



More information about the Python-list mailing list