BITRSHIFT

  • Updated

Returns a number shifted right by the specified number of bits.

Sample Usage

BITRSHIFT(13,2)
BITRSHIFT(C5,C6)

Syntax

BITRSHIFT(number,shiftby)

  • number - The number to be shifted.
  • shiftby - The number of places to shift.

Examples

BITRSHIFT(13,2) returns a value of 3.
BITRSHIFT(C5,C6) shifts C6 bits right for the number contained in C5 by adding zeros (0) to the right of the number represented in binary. The resultant number is then converted back to decimal.

Notes

  • The number must be non-negative.
  • shiftby must be a number from -52 to 53.
  • A negative shiftby value is effectively a BITLSHIFT function.
  • Values don't necessarily have to be numbers. Instead, they may be coerced. For example, a string value of "3" can be coerced to be simply 3, and a Boolean value of TRUE can be coerced to 1.