Skip to content
Permalink
Browse files

math.integers: the fixnum-log2 intrinsic didn't work due to inlining.

  • Loading branch information
mrjbq7 committed Feb 28, 2013
1 parent 4da316c commit d92e9ca8534ca2c592c602701876acf521de1f76
Showing with 3 additions and 2 deletions.
  1. +3 −2 core/math/integers/integers.factor
@@ -57,11 +57,12 @@ M: fixnum bitnot fixnum-bitnot ; inline
M: fixnum bit? fixnum-bit? ; inline

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

M: fixnum (log2) fixnum-log2 ; inline
M: fixnum (log2) fixnum-log2 { fixnum } declare ; inline

M: bignum >fixnum bignum>fixnum ; inline
M: bignum >bignum ; inline

0 comments on commit d92e9ca

Please sign in to comment.
You can’t perform that action at this time.