title: Truth table for XOR function for non binary bases
body: <p>I know that the XOR operator in base 2 for two bits A and B is (A+B)%2. In others words, it's addition modulo 2. </p>
  
  <p>If I want to compute the truth table for XOR operation in a ternary system (base 3), is it same as addition modulo 3? 
  Eg: In a base 3 system, does 2 XOR 2 = 1 (since (2+2)%3 = 1)? </p>
  
  <p>I read this <a href="http://cwestblog.com/2013/08/20/javascript-xor-in-any-base/" rel="noreferrer">link</a> which indicated that 2 XOR 2 in a base 3 system is 2 and I can't understand the formula behind that?</p>
  
  <p>In general, for any base 'x', is the XOR operation for that base - addition modulo x?</p>