The 'xor'-operator in julia is defined by the following symbol: ⊻
If I am not mistaken this is also the only symbol representing 'xor'.
How are you supposed to type this conveniently?
Am I supposed to copy or paste it into my code or remember the unicode representation by heart?
Simply hold down the Alt Key and type 8891. When you lift the Alt Key, ⊻ appears. ("Num Lock" must be on.)
Logical Operators are used to perform logical operations and include AND, OR, or NOT. Boolean Operators include AND, OR, XOR, or NOT and can have one of two values, true or false.
Julia's REPL has LaTeX-like tab-completion, so you can use \xor<tab>
. If you paste the character in the help mode (pressing ?
in the REPL) you can see how such character tab-completes:
help?> ⊻
"⊻" can be typed by \xor<tab>
help?> α
"α" can be typed by \alpha<tab>
Many editors have similar tab-completions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With