Reputation: 165
I read somewhere that they are different when the number is negative, but I did a quick test and it appears they are equivalent, at least in python?
for i in range(-1000, 1000):
assert(i >> 1 == i // 2)
assert(i << 1 == i * 2)
Upvotes: 0
Views: 54