hex/oct constants > sys.maxint will return positive values in Python 2.4 and up

Martin v. Löwis loewis at informatik.hu-berlin.de
Thu Nov 7 13:37:35 EST 2002


Jon Ribbens <jon+usenet at unequivocal.co.uk> writes:

> > The answer to your question follows from that.  If you intended a
> > 1 bit followed by 31 zero bits, then, no, -0x7fffffff-1 doesn't
> > mean that on some platforms even today (or even in 1993, for that
> > matter <wink>).
>
> What platforms doesn't it mean that on? What does it mean on those
> platforms? Are you talking about platforms with 16-bit integers?
> If so, I don't care.

64-bit platforms. -0x7fffffff-1 is 33 1 bits, followed by 31 zero
bits, on such systems. In future Python versions, it is an infinite
number of 1 bits followed by 31 zero bits.

Regards,
Martin



More information about the Python-list mailing list