xor
- logical exclusive or
A
xor
B
xor calculates logical exclusive or of
A
and
B
.
A
and
B
must be Boolean values.
if
( x
==
3 xor y
==
5 )
{ ... }
This will run the block if x is equal to 3 or y is equal to 5, but not if x is 3 and y is 5 at the same time.
See also
and
|
not
|
or