Shift operators

The shift operators << and >> perform a shift of an integral value, moving bits in the result a specified number of positions to the right or left. The result type of both shift operators is integer.

The left operand is an expression of type integer whose value is to be shifted. The right operand is the shift count, an expression of type integer whose value is the number of bits the left operand value is to be shifted.

The shift count must be a nonnegative value less than 64. If the shift value is zero, then the result value is equal to the left operand value. Values less than zero or greater than 63 will produce unpredictable results and should not be used.