bit_and
Returns the bitwise AND of two numbers.
bit_and(
a,
b,
[format="dec"],
[zeropad=0]
) -> NUMBER
Returns the bitwise AND of two numbers.
Syntaxe
var result = bit_and(5, 3); // Returns 1 (0001)
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
a | yes | - | Number (int/float), hex string (0x... #...), or binary string (0b...) | |
b | yes | - | Number (int/float), hex string (0x... #...), or binary string (0b...) | |
format | - | "dec" | Output format: 'dec', 'hex', or 'bin' | |
zeropad | - | 0 | Zero-pad hex/bin output to this width in bits (8, 16, 32, 64), 0 for no padding |