Handbook
Glossary
set-bit ( x n -- y )
Factor handbook
»
The language
»
Numbers
»
Arithmetic
»
Bitwise arithmetic
»
Additional bitwise arithmetic
Next:
clear-bit ( x n -- y )
Vocabulary
math
.
bitwise
Inputs
x
an
integer
n
an
integer
Outputs
y
an
integer
Word description
Sets the
n
th bit of
x
.
Examples
USING: math.bitwise kernel prettyprint ; 0 5 set-bit .h
0x20
See also
bit?
,
clear-bit
Definition
USING:
math
;
IN:
math.bitwise
:
set-bit
( x n -- y )
2^
bitor
;
inline