Yuari
Documentation

bit.tobit

Converts to an integer or hexadecimal string.

Syntax

bit.tobit(a: any) -> nil

Parameters

ParameterTypeDescription
aanyThe a value used by the call.

Returns

TypeDescription
nilThis function does not return a value.

Description

bit.tobit 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.tohex(a) resolve to the same implementation.

Example

print(bit.tobit(0xFFFFFFFF), bit.tohex(255))

Notes

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