shift operators?

Andrew Koenig ark at research.att.com
Mon Jan 7 16:22:01 EST 2002


Jakob> Andrew Koenig wrote:

>> Is it just backward compatibility that keeps 1<<40 from yielding
>> 1099511627776L as well?

Jakob> No, the fact that you didn't specify that you wanted long 
Jakob> arithmetic:

I know that I didn't specify long arithmetic.

The point is that other arithmetic operations, such as +, now generate
long results automatically when the result won't fit in an int.
So I was asking what is the reason that the shift operators don't
behave analogously.

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark



More information about the Python-list mailing list