I have the following from the VB.net 2003 help file:
This example uses the Xor operator to perform logical exclusion of the individual bits of two numeric expressions. The bit in the result pattern is set if only one of the corresponding bits in the operands are set.
Dim A As Integer = 10
Dim B As Integer = 8
Dim C As Integer = 6
Dim myCheck As Integer
myCheck = (A Xor B) ' Returns 2.
myCheck = (A Xor C) ' Returns 12.
myCheck = (B Xor C) ' Returns 14.
What do they mean by a bit and a bit being set? What is going on in each of these examples to cause it to produce the results?
This example uses the Xor operator to perform logical exclusion of the individual bits of two numeric expressions. The bit in the result pattern is set if only one of the corresponding bits in the operands are set.
Dim A As Integer = 10
Dim B As Integer = 8
Dim C As Integer = 6
Dim myCheck As Integer
myCheck = (A Xor B) ' Returns 2.
myCheck = (A Xor C) ' Returns 12.
myCheck = (B Xor C) ' Returns 14.
What do they mean by a bit and a bit being set? What is going on in each of these examples to cause it to produce the results?