bit. band Synchronous
Keep only bits set in every input value. Use a mask to extract a field or test whether an option bit is enabled.
Luau
bit.band(...values: any) -> numberParameters
| Parameter | Type | Description |
|---|---|---|
...values | any | Input values in order. Valid numeric inputs are processed; other values are skipped. |
Returns
numberAn unsigned 32-bit result represented as a Luau number. With no arguments, the result is 0.
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
Luau
local flags = 0x05
print(bit.band(flags, 0x01) ~= 0) -- true
print(bit.band(flags, 0x02) ~= 0) -- false