Fix portable fixnum size.

This commit is contained in:
Vincent St-Amour 2010-12-15 14:44:15 -05:00
parent 81cbf1ae1f
commit cb723092e2
2 changed files with 6 additions and 6 deletions

View File

@ -148,10 +148,10 @@
(tc-e/t 3 -PositiveFixnum) (tc-e/t 3 -PositiveFixnum)
(tc-e/t 100 -PositiveFixnum) (tc-e/t 100 -PositiveFixnum)
(tc-e/t -100 -NegativeFixnum) (tc-e/t -100 -NegativeFixnum)
(tc-e/t 2147483647 -PositiveFixnum) (tc-e/t 1073741823 -PositiveFixnum)
(tc-e/t -2147483647 -NegativeFixnum) (tc-e/t -1073741824 -NegativeFixnum)
(tc-e/t 2147483648 -Pos) (tc-e/t 1073741824 -Pos)
(tc-e/t -2147483648 -Integer) (tc-e/t -1073741825 -Integer)
(tc-e/t "foo" -String) (tc-e/t "foo" -String)
(tc-e (+ 3 4) -Pos) (tc-e (+ 3 4) -Pos)
[tc-e/t (lambda: () 3) (t:-> -PositiveFixnum : -true-lfilter)] [tc-e/t (lambda: () 3) (t:-> -PositiveFixnum : -true-lfilter)]

View File

@ -27,8 +27,8 @@
;; `fixnum?' to avoid creating platform-dependent .zo files. ;; `fixnum?' to avoid creating platform-dependent .zo files.
(define (portable-fixnum? n) (define (portable-fixnum? n)
(and (exact-integer? n) (and (exact-integer? n)
(< n (expt 2 31)) (< n (expt 2 30))
(> n (- (expt 2 31))))) (> n (- (expt 2 30)))))
;; return the type of a literal value ;; return the type of a literal value
;; scheme-value -> type ;; scheme-value -> type