How to get decimal form of largest known prime?

M.-A. Lemburg mal at egenix.com
Tue Jun 15 15:36:08 CEST 2004


Tim Peters wrote:
> [David M. Cooke]
> 
>>...
>>Interesting, because with gmpy (on a 32-bit AMD64 machine running Linux):
>>
>>
>>>>>import gmpy
>>>>>x = gmpy.mpz(2)**24036583-1
>>
>>is almost instantaneous, whereas the straight Python takes a second.
> 
> 
> The version of GMP in use is doubtless the reason.  I suspect the
> precompiled GMP that ships with mxNumber is getting long in the tooth.

The version that comes with mxNumber is GMP 3.1 which
AFAIR does not have the multiplication optiomizations
you were mentioning earlier in this thread. GMP 4.x should
be a lot faster... but then people usually don't print
large prime numbers every day :-)

FWIW, we're not working much on mxNumber anymore since it
was basically a toy project to research decimal number
interfacing in mxODBC. The licensing issues basically put
us off here, so we're still waiting for a nice C level
interface to one of the decimal type implementations
for Python out there.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jun 15 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::




More information about the Python-list mailing list