Yuari
Documentation

bit.rol

Rotates a value left or right.

Syntax

bit.rol(a: any, n: any) -> nil

Parameters

ParameterTypeDescription
aanyThe a value used by the call.
nanyThe n value used by the call.

Returns

TypeDescription
nilThis function does not return a value.

Description

bit.rol is part of the Bit operations library. The bit library performs 32-bit integer arithmetic with Luau bit32 semantics; inputs and results are normalized to 32 bits.

The operation is performed immediately using the arguments supplied at the call site.

The aliases bit.ror(a, n) resolve to the same implementation.

Example

print(bit.rol(0x12345678, 8), bit.ror(0x12345678, 8))

Notes

  • Aliases: bit.ror(a, n).
  • Values are normalized to 32-bit integers before and after each operation.