Logical shift

A logical shift is often used when its operand is being treated as a sequence of bits instead of as a number.

Logical shifts can be useful as efficient ways to perform multiplication or division of unsigned integers by powers of two.

Shifting left by n bits on a signed or unsigned binary number has the effect of multiplying it by 2n.

Shifting right by n bits on an unsigned binary number has the effect of dividing it by 2n (rounding towards 0).

In particular, C++ uses its logical shift operators as part of the syntax of its input and output functions, called "cin" and "cout" respectively.

Logical left shift one bit
Logical right shift one bit