Check out example codes for "get bitshift to wrap c++". It will help you in understanding the concepts better.

Code Example 1

//Rotating integers are done as follows
letter = ((unsigned char)letter >> 1) | (letter << 7);

Learn ReactJs, React Native from akashmittal.com