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

Prev:bitand ( x y -- z )
Next:bitxor ( x y -- z )


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 at least one of the inputs.

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

USING: math prettyprint ; 0b110 0b10 bitor .b
0b110


Notes
This word implements bitwise inclusive or, so applying it to booleans will throw an error. Boolean inclusive or is the and word.

Definition


Methods