Return the exclusive or of x and y.
For boolean expressions x and y,
xor (x, y)
is true if and only if one of x or
y is true. Otherwise, if x and y are both true or both
false, xor
returns false.
The truth table for the xor operation is
x | y | z | ||
- | - | - | ||
0 | 0 | 0 | ||
1 | 0 | 1 | ||
0 | 1 | 1 | ||
1 | 1 | 0 |
If more than two arguments are given the xor operation is applied cumulatively from left to right:
(…((x1 XOR x2) XOR x3) XOR …)
See also: and, or, not.
Package: octave