hex/oct constants > sys.maxint will return positive values in Python 2.4 and up
Bengt Richter
bokr at oz.net
Thu Nov 7 12:56:44 EST 2002
On Thu, 07 Nov 2002 17:16:53 -0000, Jon Ribbens <jon+usenet at unequivocal.co.uk> wrote:
>In article <mailman.1036637768.2375.python-list at python.org>, Tim Peters wrote:
>> You didn't answer the question about what you *intended* 0x80000000 to mean.
>
>I intend it to mean a set bit followed by 31 cleared bits.
>
>> 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.
How about
BIT31 = 1<<31
and then use BIT31 wherever?
Regards,
Bengt Richter
More information about the Python-list
mailing list