xor_bits

Definition: atom x3 = xor_bits(atom x1, atom x2)
Description: Perform the logical XOR (exclusive OR) operation on corresponding bits in x1 and x2.
A bit in x3 will be 1 when one of the two corresponding bits in x1 or x2 is 1, and the other is 0.
Comments: This function may be applied to an atom or sq_xor_bits() to all elements of a sequence. The rules for sequence operations apply.

The arguments must be representable as 32-bit numbers, either signed or unsigned.

If you intend to manipulate full 32-bit values, you should declare your variables as atom, rather than integer. The integer type is limited to 31-bits.

Results are treated as signed numbers. They will be negative when the highest-order bit is 1.
Example:
a = xor_bits(#0110, #1010)
-- a is #1100
See Also: and_bits, or_bits, not_bits, int_to_bits, int_to_bytes