Documentation/Calc Functions/BITRSHIFT

Function name:
BITRSHIFT

Category:
Mathematical

Summary:
Right shifts a non-negative integer value by the specified number of bits.

Syntax:
BITRSHIFT(Number; Shift)

Returns:
Returns a non-negative integer, that is the original number shifted by the specified number of bits.

Arguments:
Number is an integer in the range [0, 248-1], or a reference to a cell containing that number, that is the value to be shifted.

Shift is an integer, or a reference to a cell containing that number, that is the number of bit positions to shift. If Shift is positive, then Number is shifted to the right. If Shift is negative, then Number is shifted to the left and this would be equivalent to BITLSHIFT(Number; -Shift).


 * If either Number or Shift is non-numeric, then BITRSHIFT reports a #VALUE! error.
 * If either Number or Shift is a non-integer value, then BITRSHIFT converts it to an integer by taking its floor value.
 * If Number is less than 0 or greater than 248-1, then BITRSHIFT reports an invalid argument error (Err:502).

Additional details:

 * A right shift by N (N > 0) is equivalent to dividing by 2N and taking the floor value of the result. This effectively adds zeros at the left end of the binary representation of the number and drops digits from the right end.
 * More information is available on Wikipedia’s Bitwise operation page.
 * 248 is equal to 281474976710656.

Related LibreOffice functions:
BITAND

BITLSHIFT

BITOR

BITXOR

ODF standard:
Section 6.6.5, Part 2

Equivalent Excel functions:
BITRSHIFT