Handbook
Glossary
bits>number ( seq -- number )
Factor handbook
»
The language
»
Numbers
»
Arithmetic
»
Bitwise arithmetic
»
Integer virtual sequences
Prev:
make-bits ( number -- bits )
Next:
binary-bits
Vocabulary
math
.
bits
Inputs
seq
a
sequence
Outputs
number
an
integer
Word description
Converts a sequence of booleans in ascending significance into a number.
See also
make-bits
Definition
USING:
kernel
math
sequences
;
IN:
math.bits
:
bits>number
( seq -- number )
<reversed>
0
[
[
1
shift
]
dip
[
1
+
]
when
]
reduce
;