Integer Overflow
Fernando Pérez
fperez528 at yahoo.com
Mon Nov 26 06:24:40 EST 2001
Hans Nowak wrote:
> Ursus Horibilis wrote:
>>
>> Is there a way to force the Python run time system to ignore
>> integer overflows? I was trying to write a 32-bit Linear
>> Congruential Pseudo Random Number Generator
>
> Use longs:
Not sure if that will work for him: longs are precisely 'long', and he may
need the 32-bitness of the ints (it is a 32-bit LCPRNG, after all). Also,
unless this is just an academic exercise, speed may be critical. For real
world use, speed *is* critical in RNGs. Longs are dog slow.
Cheers,
f
More information about the Python-list
mailing list