in reply to behavior of bitwise shift

This site might help you understand the bitwise shift. I agree with the others that there is a better way for you to do whatever it is you want.