Advertisement
ZoriaRPG

Logical Xor for std.zh

Apr 28th, 2018
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. //The most efficient Logical Xor function possible.
  2. //Minimum statement evaluations (1)
  3. //Maximum statement evaluations (3)
  4. bool Xor(bool a, bool b)
  5. {
  6.      if ( a )
  7.      {
  8.           if ( !b ) return true;
  9.      }
  10.      else
  11.      {
  12.           if ( b ) return true;
  13.      }
  14.      return false;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement