Handbook
Glossary
fixnum-bit-count ( x -- n )
Vocabulary
math
.
bitwise
.
private
Inputs
x
an
object
Outputs
n
an
object
Definition
USING:
combinators
kernel
kernel.private
layouts
math
;
IN:
math.bitwise.private
:
fixnum-bit-count
( x -- n )
{
fixnum
}
declare
{
[
byte-bit-count
]
[
-8
shift
byte-bit-count
+
]
[
-16
shift
byte-bit-count
+
]
[
-24
shift
byte-bit-count
+
]
[
cell
8
=
[
{
[
-32
shift
byte-bit-count
+
]
[
-40
shift
byte-bit-count
+
]
[
-48
shift
byte-bit-count
+
]
[
-56
shift
byte-bit-count
+
]
}
cleave
>fixnum
]
[
drop
]
if
]
}
cleave
;