title: Why do a lot of languages lack a logical XOR operator?
body: <p>Off the top of my head, I cannot think of a single language I've used that had a logical exclusive or operator, but all have logical and bitwise <code>and</code> and <code>or</code> operators.</p>
  
  <p>Looking around, the only reason to this that I could find was that exclusive or cannot be short circuited, so a logical version would be useless, which I really can't see being the case. The reason it came to my attention that most languages lack this is that I needed it (I was using Ruby, so I wrote a method to convert an integer to a boolean, and then use bitwise XOR, which on booleans acts like logical XOR).</p>
  
  <p>Just using bitwise XOR does not work either, because it will give a different result.</p>
  
  <pre><code>0b0001  ^  0b1000 = 0b1001 (True)
  0b0001 XOR 0b1000 = False
  // Where ^ is bitwise exclusive or and XOR is logical exclusive or
  // Using != (not equal to) also doesn't work
  0b0001 != 0b1000 = True
  </code></pre>
  
  <p>So why is it that most languages do not include a logical exclusive or operator?</p>
  
  <p><em>Edit</em>: I added an example with how <code>!=</code> also does not do what I want, it almost does, but falls into the <em>same</em> problem that using bitwise exclusive or does, it only works if you know that you are working with zero or one, and not any other number.</p>
  
  <p>And to note, this is assuming that language uses zero as false and nonzero as true.</p>