XOR of three values
For exactly three terms, you can use this expression: (a ^ b ^ c) && !(a && b && c) The first part is true iff one or three of the terms are true. The second part of the expression ensures that not all three are true. Note that the above expression does NOT generalize … Read more