Saturday, August 2, 2008

Clear your concept on shift operators

Shift Operators

Shift left

a <<>

Shift all bits in a left n times, filling with 0 from the right.

Shift right with sign bit

a >> n

Shift all bits in a right n times, filling with the sign bit from the left.

Shift right with zero fill

a >>> n

Shift all bits in a right n times, filling with 0 from the left.

0 comments: