New submission from Mark Dickinson <[EMAIL PROTECTED]>:

In Python 2.6a3:

>>> 1 >> (2**31)  # unexpected exception
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: long int too large to convert to int
>>> 1 >> (2**31-1)  # works as expected
0L

It might make more sense for the first expression to return 0 instead.
Similarly, perhaps 0 << (2**31) should also return 0.

----------
components: Interpreter Core
messages: 66484
nosy: marketdickinson
severity: normal
status: open
title: Integer right shift raises OverflowError when second operand is large
type: behavior
versions: Python 2.6, Python 3.0

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2804>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to