Integer multiplication overflow.

Aahz Maruch aahz at panix.com
Sun Oct 8 11:04:51 EDT 2000


In article <iQ%D5.535$Y32.50259 at newsb.telia.net>,
Fredrik Lundh <effbot at telia.com> wrote:
>Aahz wrote:
>>>Python undecorated integers are fixnums (in scheme/lisp/fp terms) --
>>>32-bit signed fixnums (that's somewhat larger than a typical lisp's
>> ^^^^^^
>>>implementation fixnums, a range of about +/- 2 billions).  
>> 
>> Wrong.  They're whatever the platform int gives you, which will be
>> 64-bit in many cases -- and more all the time.
>
>Wrong.  They're whatever the platform *long* gives you:

Heh.  I wrote "long" first, then decided my memory was wrong and didn't
feel like looking it up.  I guess I should trust myself more.

>Note that most (all?) 64-bit Unixes are LP64, where an int is
>32 bits and longs and pointers are 64 bits.

I remember Tim Peters posting a while back that some he'd run across at
least one where sizeof(long)==8.  Ah, here it is:

http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=583042149&fmt=text
-- 
                      --- Aahz (Copyright 2000 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

"[I have a] windmill fetish."  --Darkhawk



More information about the Python-list mailing list