# Expression XOR Null

**URL:** <https://forum.inductiveautomation.com/t/expression-xor-null/87965>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 27, 2024, 1:24pm UTC](https://forum.inductiveautomation.com/t/expression-xor-null/87965 "2024-03-27T13:24:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 27, 2024, 1:24pm UTC](https://forum.inductiveautomation.com/t/expression-xor-null/87965/1 "2024-03-27T13:24:37Z")

</div>

I'm using `xor` in an expression binding and it's throwing an error that xor can't handle

```auto
null xor null

```

Shouldn't this just evaluate to false? I can wrap it in a `try()` to get rid of the error until those values are non-null, but this just seems like odd behavior, considering `||` and `&&` can handle null just fine.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 27, 2024, 1:27pm UTC](https://forum.inductiveautomation.com/t/expression-xor-null/87965/2 "2024-03-27T13:27:20Z")

</div>

`xor` is bitwise, like `|` and `&`, not boolean like `||` and `&&`. Consider using `coalesce()` to convert nulls to zero. Also, if you are trying to get true boolean xor, you will need to ensure your `true` values are really integer `1` to avoid unexpected results. `1 xor 3` yields `2`, not `false`.

> **[Expression Language and Syntax | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/expression-language-and-syntax#operators)**
>
> Expression Language
