bit.shiftRight

Syntax bit.shiftRight (bits, ctShift)

Params bits is a 32-bit number.

ctShift is a number between 0 and 31

Action Shifts bits right ctShift times

Returns The shifted value.

Examples bit.shiftRight (128, 2)

   » 32

string.hex (bit.shiftRight (0x1FFFF, 2))

   » "0x7FFF"

Notes Each left shift divides the value of bits by 2

See Also bit.shiftLeft

bit.get

bit.logicalAnd

Discuss