nand()

Performs a bitwise NAND (NOT AND) operation on one or more integers.

Syntax

nand(value1, [value2, ...])

Parameters

Parameter Type Description
value1 Number The first integer value.
value2..N Number Additional integer values to apply NAND with. optional

Return Value

Examples

Single value, returns NOT of itself

nand(5);      // returns 4294967290 (~5)

Bitwise AND of 5 (0101) and 3 (0011) → 0001
Bitwise NOT of 0001 → 1110

nand(5, 3);   // returns 4294967294

Bitwise AND of 7 (0111), 3 (0011), and 1 (0001) → 0001
Bitwise NOT of 0001 → 1110

nand(7, 3, 1); // returns 4294967294

See also

bit
not
and
or
xor
nand
nor
xnor
shl
shr