Shift operators shift the bits in an expression to the left or to the right. The integer expression on the right of the operator determines how many places to the left or right to shift the bits within the expression on the left of the operator. When shifting left, all bits in the expression are shifted left one position and a zero is placed on the right. When shifting right, all bits in the expression are shifted right one position and a zero is placed on the left.
In the examples below, the bitwise value of “a” is 1010 0110 and “b” is equal to 2.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |