bitxor ( x y -- z )
Factor handbook » The language » Numbers » Arithmetic » Bitwise arithmetic

Prev:bitor ( x y -- z )
Next:bitnot ( x -- y )

Vocabulary
math

Inputs
xan integer
yan integer
Outputs
zan integer
Word description
Outputs a new integer where each bit is set if and only if the corresponding bit is set in exactly one of the inputs.

Examples
USING: math prettyprint ; 0b101 0b10 bitxor .b
0b111

USING: math prettyprint ; 0b110 0b10 bitxor .b
0b100
Notes
This word implements bitwise exclusive or, so applying it to booleans will throw an error. Boolean exclusive or is the xor word.

DefinitionMethods