Xor

Function

Xor(conditions...)

conditions

Xor is included by default in each file as part of the Logic library.

 

See also:


Use

The Xor() function checks if there are an odd number of true boolean values given as an input.

If there are an odd number of inputs that are true, then the result is true. If there are an even number of inputs that are true, then the result is false.

When just two inputs are given, you can think of Xor() as "one or the other must be true, but not both".

Examples
  • Xor(true, false)  = true
  • Xor(false, false)  = false
  • Xor(true, true)  = false
  • Xor(false, true)  = true
  • Xor(false, false, true)  = true
  • Xor(1 > 0, 1 < 2)  = false
  • Xor(2*2 == 4, 2*2 < 0)  = true