Command Summary

Exclusive or statement. Returns the truth value of value1 or value2, but not both, being true.

Command Syntax

value1 xor value2

xor takes two numbers of expressions and checks to see if exactly one is True. If both are True or both are False, it returns 0.

1 xor 0

:2 xor (3 xor 0)    (after evaluating 3 xor 0, it simplifies into True xor True.)

:0 xor (1-1)^2

Table of Results

For reference, the following true/false table shows what gets returned when you use different combinations of 1 (true) and 0 (false):

xor 1 (true) 0 (false)
1 (true) 0 (false) 1 (true)
0 (false) 1 (true) 0 (false)

Related Commands

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.