math.integers: simplify fixnum-bit?.

db4
John Benediktsson 2015-06-17 18:42:11 -07:00
parent fda90b2beb
commit db9cfeeae2
1 changed files with 3 additions and 4 deletions

View File

@ -52,11 +52,10 @@ M: fixnum shift integer>fixnum fixnum-shift ; inline
M: fixnum bitnot fixnum-bitnot ; inline M: fixnum bitnot fixnum-bitnot ; inline
: fixnum-bit? ( x n -- ? ) : fixnum-bit? ( x n -- ? )
integer>fixnum-strict dup 0 >= [ { fixnum fixnum } declare
neg shift even? not dup 0 >= [ neg shift even? not ] [ 2drop f ] if ; inline
] [ 2drop f ] if ; inline
M: fixnum bit? fixnum-bit? ; inline M: fixnum bit? integer>fixnum-strict fixnum-bit? ; inline
: fixnum-log2 ( x -- n ) : fixnum-log2 ( x -- n )
{ fixnum } declare { fixnum } declare