layouts: most-positive/negative-fixnum return fixnums now

db4
Slava Pestov 2009-09-29 22:27:54 -05:00
parent 4ae9e71f5c
commit 3e27d06914
4 changed files with 7 additions and 4 deletions

View File

@ -6,3 +6,6 @@ IN: system.tests
! Smoke test
[ t ] [ max-array-capacity cell-bits 2^ < ] unit-test
[ t ] [ most-negative-fixnum fixnum? ] unit-test
[ t ] [ most-positive-fixnum fixnum? ] unit-test

View File

@ -49,10 +49,10 @@ SYMBOL: mega-cache-size
cell-bits (first-bignum) ; inline
: most-positive-fixnum ( -- n )
first-bignum 1 - ; inline
first-bignum 1 - >fixnum ; inline
: most-negative-fixnum ( -- n )
first-bignum neg ; inline
first-bignum neg >fixnum ; inline
: (max-array-capacity) ( b -- n )
5 - 2^ 1 - ; inline

View File

@ -127,7 +127,7 @@ PRIVATE>
! Make sure it's a fixnum here to speed up double-hashing.
: hashcodes-from-hashcode ( n -- n n )
dup most-positive-fixnum >fixnum bitxor ;
dup most-positive-fixnum bitxor ;
: hashcodes-from-object ( obj -- n n )
hashcode abs hashcodes-from-hashcode ;

View File

@ -41,7 +41,7 @@ IN: project-euler.044
PRIVATE>
: euler044 ( -- answer )
most-positive-fixnum >fixnum
most-positive-fixnum
2500 [1,b] [
dup [1,b] [
euler044-step