Remix.run Logo
▲ adrian_b an hour ago

"XOR" is actually an incorrect name for addition modulo 2. For 3 or more inputs, true "XOR" and addition modulo 2 give different results ("exclusive or" means that 1 and only 1 of the operands is true, "addition modulo 2" means that an odd number of operands are true). No computer implements true "XOR", all implement addition modulo 2.

Addition modulo 2 is special, because it is identical with subtraction modulo 2. This means that computer "XOR" has 2 possible interpretations, as addition modulo 2 and as subtraction modulo 2.

Because addition modulo 2 is special, some of the algorithms that work with additions in bigger fields also work modulo 2, but other algorithms are no longer applicable.