bit.bnot Synchronous

Invert all 32 bits of a number. The returned value is unsigned, so the complement of zero is 4294967295 rather than -1.

Syntax
Luau
bit.bnot(value: number) -> number

Parameters

Function parameters
ParameterTypeDescription
valuenumberFinite number, truncated and normalized to 32 bits before inversion.

Returns

number

An unsigned 32-bit result represented as a Luau number.

Differences from Volt

Volt documents its Bit Library setting as disabled by default. Kawaii enables bit by default. Disabling the setting removes the bit global and makes retained function references reject calls.

Availability

Bit is enabled by default. The bit global is removed when disabled, and its operations check the setting.

Example

Example
Luau
print(bit.tohex(bit.bnot(0))) -- ffffffff
Kawaii documentation