updating oE xor_bits


<built-in> function xor_bits(object a, object b) 

performs the bitwise XOR operation on corresponding bits in two objects. A bit in the result will be 1 only if the corresponding bits in both arguments are different.

  1. a : one of the objects involved
  2. b : the second object

An object, whose shape depends on the shape of both arguments. Each atom in this object is obtained by bitwisel XOR between atoms on both objects.


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. Euphoria's 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 1:
 a = xor_bits(#0110, #1010) 
-- a is #1100 
See Also:

and_bits, or_bits, not_bits, int_to_bits

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu