Handbook
Glossary
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
x
an
integer
n
an
integer
Outputs
y
an
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
USING:
math
;
IN:
math.bitwise
:
mask
( x n -- y )
bitand
;
inline