bit.bnot Synchronous

Invert every bit in a 32-bit value. Combine it with band to clear selected flags while preserving the others.

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

Parameters

Function parameters
ParameterTypeDescription
valuenumberNumber to interpret as a 32-bit value.

Returns

number

The 32-bit bitwise complement.

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
local flags = 0x07
print(bit.band(flags, bit.bnot(0x02))) -- 5
Kawaii documentation