Handbook
Glossary
bit-weight ( n -- m )
Vocabulary
math
.
intervals
.
private
Inputs
n
an
object
Outputs
m
an
object
Definition
USING:
kernel
math
;
IN:
math.intervals.private
:
bit-weight
( n -- m )
dup
[
-1/0.
=
]
[
1/0.
=
]
bi
or
[
drop
1/0.
]
[
dup
0
>
[
1
+
]
[
neg
]
if
next-power-of-2
]
if
;