…int-expr… << …int-expr…
…int-expr… >> …int-expr…
int, int -> int
Shift its first integer operand by the number of bits indicated by its second operand, to the left or to the right.
For right shifts, sign will be extended if the first operand is signed.
expression | evaluates to |
---|---|
1029 >> 3 | 128 |
5 << 3 | 40 |
-4 >> 1 | -2 |