Navigation

Operators and Keywords

Function List:

C++ API

: z = xor (x, y)
: z = xor (x1, x2, …)

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

xyz
---
000
101
011
110

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