+ 1
Bitwise operator
Can somebody explain why this results in 32? x=5 print(x>>2<<x) I know 5>>2 is 1 And 2<<5 is 64. Where does the 32 come from?
3 odpowiedzi
+ 3
x = 5 (0000 0101)
1. 5 >> 2 (0000 0001) = 1
2. 1 << 5 (0010 0000) = 32
0
Got it. Thanks!