Integer multiplication overflow.

Fredrik Lundh effbot at telia.com
Sun Oct 8 10:49:50 EDT 2000


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:

    typedef struct {
        PyObject_HEAD
        long ob_ival;
    } PyIntObject;

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

</F>




More information about the Python-list mailing list