lxor()

Performs a logical XOR (exclusive OR) operation.

Returns `1` if exactly one of the values is nonzero, otherwise returns `0`.

Syntax

lxor(value1, value2)

Parameters

Parameter Type Description
value1 Number The first numeric value to check.
value2 Number The second numeric value to check.

Return Value

Examples

lxor(1, 0);   // returns 1
lxor(0, 1);   // returns 1
lxor(1, 1);   // returns 0
lxor(0, 0);   // returns 0
lxor(3, -2);  // returns 0

See also

lnot
land
lor
lxor
lnand
lnor
lxnor