Skip to main content

Integer.bit_shift_r

bit_shift_rthat

Group: Bitwise

Documentation

Performs a bitwise right-shift on the number. Left-shifts fill the new bits with zeroes, while right-shifts perform sign extension. Returns an error if the shift amount exceeds 2^32.

Arguments

  • that: The number of bits by which the shift should be performed. Positive numbers perform a right-shift, while negative numbers perform a left-shift.

Examples

Shift the bits of the number 1 right by four bits.

      1.bit_shift_r 4