PLAYGROUND (experimental)

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

NameTypeRequiredDefaultDescription
ayes-Number (int/float), hex string (0x... #...), or binary string (0b...)
byes-Number (int/float), hex string (0x... #...), or binary string (0b...)
format-"dec"Output format: 'dec', 'hex', or 'bin'
zeropad-0Zero-pad hex/bin output to this width in bits (8, 16, 32, 64), 0 for no padding