mask ( x n -- y )
Factor handbook » The language » Numbers » Arithmetic » Bitwise arithmetic » Additional bitwise arithmetic

Prev:toggle-bit ( m n -- m' )
Next:unmask ( x n -- y )


Vocabulary
math.bitwise

Inputs
xan integer
nan integer


Outputs
yan integer


Word description
After the operation, only the bits that were set in both the mask and the original number are set.

Examples
USING: math.bitwise kernel prettyprint ; 0b11111111 0b101 mask .b
0b101


Definition