Handbook
Glossary
first-set-bit ( x -- n )
Vocabulary
random
.
sfmt
.
private
Inputs
x
an
object
Outputs
n
an
object
Definition
USING:
combinators.short-circuit
kernel
math
;
IN:
random.sfmt.private
:
first-set-bit
( x -- n )
0
swap
[
dup
{
[
0
>
]
[
1
bitand
0
=
]
}
1&&
]
[
[
1
+
]
[
-1
shift
]
bi*
]
while
drop
;