Handbook
Glossary
bits
Factor handbook
»
The language
»
Numbers
»
Arithmetic
»
Bitwise arithmetic
»
Integer virtual sequences
Next:
<bits> ( number length -- bits )
Vocabulary
math
.
bits
Class description
Tuple representing a number as a virtual sequence of booleans. The first bit is the least significant bit. Constructors are
<bits>
or
make-bits
.
Definition
IN:
math.bits
TUPLE:
bits
{
number
read-only
}
{
length
read-only
}
;
Methods
USING:
accessors
math.bits
sequences
;
M:
bits
length
length>>
;
inline
USING:
accessors
kernel
math
math.bits
sequences.private
;
M:
bits
nth-unsafe
number>>
swap
bit?
;
inline