http://en.wikipedia.org/wiki/Bithttp://en.wikipedia.org/wiki/Binary_numeral_systemBitwise operation: A operation executed on every single digit of binary data.
E.g. Negation. NOT 01001011 = 10110100
http://en.wikipedia.org/wiki/Integertruncate: See any dictionary.
You have some number: 3.141592...
calculate 3.141592... ^ 0
this requires an implicit transformation to an integer,
so you get 3^0, your number got truncated
3 = 00000011, 0 = 00000000
now you calculate a bitwise XOR
according to the table above
(xor with 0 doesn't change anything)
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
- Code: Select all
00000011
XOR 00000000
= 00000011
and you get 3 as result.