Let 1 be a 32 bit integer in Java, what should 1<<32 be?
0? Because the "1" bit will be shifted to the far left?
In fact, it is 1. See in the Java programming spec, "If the promoted type of the left-hand operand is int, only the five lowest-order bits of the right-hand operand are used as the shift distance. It is as if the right-hand operand were subjected to a bitwise logical AND operator & with the mask value 0x1f. The shift distance actually used is therefore always in the range 0 to 31, inclusive." So << can be considered as a cyclic left shift operation, the bits shifted on the left end will reappear on the right end.
Saturday, February 06, 2010
Subscribe to:
Post Comments (Atom)

3 comments:
好多很有用資訊...感謝你的分享喔 ........................................
Always read stuff that will make you look good if you die in the middle of it.............................................
男同志色教館av影片杜雷斯正妹牆月宮貼圖微風寫真館正妹牆帶回家正妹牆成人網正妹貼圖區正妹牆成人網sexav999免費影片日本情色小說日本情色影片日本情人趣味日本情侶自拍日本情侶成人影片日本愛情動畫日本愛情卡通日本情色bt日本情色av女優日本性教育影片視訊 辣妹美女 視訊線上a片打手槍凹凸電影院愛愛一葉情貼影色站露點girl5320免費a片下載成人情色18成人免費girl5320貼影片foxy下載kiss168成人辣妹視訊論壇男人的最愛線上看av080聊天室 曼雪兒情色文學小說曼雪兒情色文學網曼雪兒免費成人小說曼雪兒小說曼雪兒影片
Post a Comment