xor

Syntax

xor(X, Y)

Details

Pair each elements in X and Y to perform the "exclusive or" operation.

Parameters

X and Y can be a scalar, pair, vector or matrix.

Returns

It returns a Boolean scalar, pair, vector, matrix, or table representing the result of the logical XOR operation between X and Y.

Examples

1 xor 0
// output: 1

x = 5 6 7
x xor 0
// output: [1,1,1]

x = 1 2 3
y = 2 1 3
x xor y
// output: [0,0,0]

true xor false
// output: 1

Related function: or, not