# Futurebasic/Language/Reference/xor

## XOREdit

### SyntaxEdit

result& = exprA {XOR | ^^} exprB

### DescriptionEdit

Expression

and expression *exprA*

are each interpreted as 32-bit integer quantities. The *exprB*

operator performs a "bitwise comparison" of each bit in **XOR**

with the bit in the corresponding position in *exprA*

. The result is another 32-bit quantity; each bit in the result is determined as follows:
*exprB*

<image was here>

A common use for

is to toggle the state of individual bits in a bit pattern. For example:
**XOR**

` pattern& = pattern& `

**XOR** **BIT**(7)

This flips bit 7 in `pattern&`

from 0 to 1 or from 1 to 0, and leaves all of `pattern&`

's other bits alone.

### ExampleEdit

The example below shows how bits are manipulated with

:
**XOR**

DEFSTR LONG PRINT BIN$(923) PRINT BIN$123) PRINT "--------------------------------" PRINT BIN$(923 XOR 123) program output: <code>00000000000000000000001110011011 00000000000000000000000001111011 -------------------------------- 00000000000000000000001111100000