Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Discrete Mathematics > Boolean Computation > Bitwise Operations >
Mathematica > Mathematics and Algorithms > Logic & Boolean Algebra > Boolean Computation > Bitwise Operations >

BitXor

BitXor[n1, n2, ...]
gives the bitwise XOR of the integers ni.
  • Integer mathematical function, suitable for both symbolic and numerical manipulation.
  • BitXor[n1, n2, ...] yields the integer whose binary bit representation has ones at positions where an odd number of the binary bit representations of the ni have ones.
  • For negative integers BitXor assumes a two's complement representation.
  • BitXor automatically threads over lists.
Use numbers of any size:
BitXor takes any number of arguments:
Use negative numbers:
Basic symbolic simplifications are done automatically:
Make a nested pattern:
Generate a Gray code sequence [more info]:
Bitwise version of rule 60 cellular automaton:
Truth table for Xor:
Even numbers of identical arguments give 0:
"Munching squares" [more info]:
New in 4
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team