Search code examples
operators

What are XAND and XOR


What are XAND and XOR? Also is there an XNot


Solution

  • XOR is short for exclusive or. It is a logical, binary operator that requires that one of the two operands be true but not both.

    So these statements are true:

    TRUE XOR FALSE
    FALSE XOR TRUE
    

    And these statements are false:

    FALSE XOR FALSE
    TRUE XOR TRUE
    

    There really isn't such a thing as an"exclusive and" (or XAND) since in theory it would have the same exact requirements as XOR. There also isn't an XNOT since NOT is a unary operator that negates its single operand (basically it just flips a boolean value to its opposite) and as such it cannot support any notion of exclusivity.