# symmetricDifference\(set\)/bitXor\(^\) {#symmetricdifferencesetbitxor}

**Parent topic:**[Operators](../../../Programming/Operators/Operators.md)

## Syntax {#syntax}

Set Operation: X ^ Y or X symmetricDifference Y or symmetricDifference\(X,Y\)

Bit Operation: X ^ Y or X bitXor Y or bitXor\(X, Y\)

## Arguments {#arguments}

Set Operation: X and Y are sets.

Bit Operation: X and Y are equal sized vectors, or Y is a scalar.

## Details {#details}

Set Operation: Return the union of two sets minus the intersection of the two sets.

Bit Operation: Return the result of bitXor operation.

## Examples {#examples}

```
// symmetric difference
x=set([5,3,4]);
y=set(8 9 4 6);
y^x;
// output: set(5,8,3,9,6)
x^y;
// output: set(8,5,3,6,9)

// bitXor
x=1 0 1;
y=0 1 1;
x^y;
// output: [1,1,0]
```

