Integer literal overflow error with -2147483648 but not with 0x80000000 ?

Adrian Eyre a.eyre at optichrome.com
Tue Jan 25 06:05:18 EST 2000


> >>> 0x80000000
> -2147483648
> >>> -2147483648
> Traceback (innermost last):
> OverflowError: integer literal too large

I'm guessing this is because Python parses it as:

-(2147483648)

and can't evaluate 2147483648 before making it negative.

--------------------------------------------
Adrian Eyre <a.eyre at optichrome.com>
http://www.optichrome.com 





More information about the Python-list mailing list