A bit shift operation moves the bits contained in a binary numeral or bit pattern to the left or to the right.
A bit shift operation moves the bits contained in a binary numeral or bit pattern to the left or to the right, often written as <<
and >>
respectively.
For example 4<<3 = 32
and 5>>1 = 2
.
A zero shift returns the integer part, e.g. 3.14<<0 = 3
.