Handbook
Glossary
bit? ( x n -- ? )
Factor handbook
»
The language
»
Numbers
»
Arithmetic
»
Bitwise arithmetic
»
Additional bitwise arithmetic
Prev:
clear-bit ( x n -- y )
Next:
bit-range ( x high low -- y )
Vocabulary
math
Inputs
x
an
integer
n
an
integer
Outputs
?
a
boolean
Word description
Tests if the
n
th bit of
x
is set.
Examples
USING: math prettyprint ; 0b101 2 bit? .
t
See also
set-bit
,
clear-bit
Definition
IN:
math
GENERIC#:
bit?
1
( x n -- ? )
foldable
flushable
Methods
USING:
math
math.private
;
M:
bignum
bit?
bignum-bit?
;
inline
USING:
math
math.integers.private
;
M:
fixnum
bit?
integer>fixnum-strict
fixnum-bit?
;
inline