Bit32.arshift

Available since: Gideros 2022.3
Class: bit32

Description

Returns the number x shifted disp bits to the right. The number disp may be any representable integer. Negative displacements shift to the left.

(number) = bit32.arshift(x,disp)
This shift operation is what is called arithmetic shift. Vacant bits on the left are filled with copies of the higher bit of x; vacant bits on the right are filled with zeros. In particular, displacements with absolute values higher than 31 result in zero or 0xFFFFFFFF (all original bits are shifted out)

Parameters

x: (number) the number whose bits shall be shifted
disp: (number) the integer number of bits to shift by

Return values

Returns (number) result

See also

Bitwise Operators