Page 1 of 1

PostPosted: Thu Jul 05, 2001 2:00 am
by Dman
What exactly does the XOR keyword do? I have not been able to find anything on it and have never used it in any other language I know.

PostPosted: Mon Jul 09, 2001 2:03 pm
by ianf
XOR is exclusive or. The regular or is more like an and/or. The easiest way to see the difference is to find examples of the truth tables for the various Boolean expressions.

In essence the result is true if one or the other value is 'whatever you are testing' but not both.


If that's all wrong it's a long time since I went to college :)

PostPosted: Tue Jul 10, 2001 7:28 am
by guy
The truth table for XOR is:

0 xor 0 = 0
1 xor 0 = 1
0 xor 1 = 1
1 xor 1 = 0

In C and PocketC XOR is a bitwise operation between two integers taken as bit patterns.