Handbook Glossary
factorcode.org
fixnum-log2 ( x -- n )


Vocabulary
math.integers.private

Inputs
xan object


Outputs
nan object


Definition
USING: kernel kernel.private math math.private ;

IN: math.integers.private

: fixnum-log2 ( x -- n )
{ fixnum } declare 0 swap
[ dup 1 eq? ] [ [ 1 fixnum+fast ] [ 2/ ] bi* ] until drop ;