Livecode Wiki

Performs a "bitwise exclusive or" on the binary representation of two numbers.Syntax:

<number1> bitXOr <number2>

Examples:

1 bitXOr 0 -- evaluates to 1
6 bitXOr 4 -- in binary: 110 bitXOr 100; evaluates to 010; converts to 2

Use the bitXOr operator to operate directly on the bits of two numbers.

To perform the bitXOr operation, LiveCode first converts both operands to their binary equivalent, a string of ones and zeroes. 1 is equivalent to true, and 0 is equivalent to false.

For each bit of number1, LiveCode performs an exclusive or operation with the corresponding bit of number2 to produce a result. A bit is 0 if the corresponding bits of number1 and number2 are both 0 or both 1. Otherwise, the bit is 1.

Finally, the binary number thus created is converted back to decimal.

Parameters:

  • number1: The number1 and number2 are numbers, or expressions that evaluate tonumbers.
  • number2:
  • Description:Use the bitXOr operator to operate directly on the bits of twonumbers.

See also: or (operator),bitNot (operator),