BITRSHIFT (Number, ShiftAmount) BITRSHIFT (Number; ShiftAmount)
Number
Number Number
The number to be shifted right.
ShiftAmount
Number Number
The number of bits to shift the number. A negative shift amount shifts the number left instead.
Returns
Number Number
The shifted number.
Shifts a number right by the specified number of bits. Shifting a number right by one bit divides it by two and discards the remainder, so shifting it right by three bits divides it by eight and discards the remainder.
The number and the result must be non-negative integers less than 2 raised to the power of 48. Other numbers result in an error.
Examples
Returns "00000100".
BITRSHIFT (19, 2)
BITRSHIFT (19; 2)
Returns 4. This example is equivalent to the preceding example, but does not convert the decimal numbers to binary to ease readability.