Max Long

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Jan 21 20:42:27 EST 2008


En Mon, 21 Jan 2008 22:02:34 -0200, mensanator at aol.com  
<mensanator at aol.com> escribió:

> On Jan 21, 5:36 pm, Gary Herron <gher... at islandtraining.com> wrote:
>> tjhn... at gmail.com wrote:

>> > How can I figure out the largest long available?  I was hoping for
>>
>> There is no explicit (defined) limit.  The amount of available address
>> space forms a practical limit.
>
> But not the only limitation:
> [...]
> Traceback (most recent call last):
>   File "<pyshell#12>", line 2, in <module>
>     a = cf.Type12MH(k,1)
>   File "C:\Program Files\PyGTK\Python\lib\collatz_functions.py", line
> 745, in Type12MH
>     return TWO**(SIX*a - ONE) - ONE
> ValueError: mpz.pow outrageous exponent
>
> The power function can't do exponents that have 32 or more bits
> even if the memory can hold the resulting number.

Isn't it a limitation of the gmpy library, not of the builtin long type?

-- 
Gabriel Genellina




More information about the Python-list mailing list