bitor ( x y -- z )
Factor documentation > Factor handbook > The language > Numbers > Arithmetic > Bitwise arithmetic
Prev:bitand ( x y -- z )
Next:bitxor ( x y -- z )


Vocabulary
math

Inputs and outputs
xan integer
yan integer
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
111

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


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

Definition
IN: math

MATH: bitor ( x y -- z ) foldable flushable


Methods
USING: math math.private ;

M: bignum bitor bignum-bitor ; inline


USING: math math.private ;

M: fixnum bitor fixnum-bitor ; inline