Fix type of `zero?' to properly handle 0.0.

This commit is contained in:
Sam Tobin-Hochstadt 2010-06-11 18:54:05 -04:00
parent 1a80b6b044
commit 7ece2a4872
2 changed files with 3 additions and 1 deletions

View File

@ -807,6 +807,7 @@
(vector-ref #("a" "b") (sub1 x)) (vector-ref #("a" "b") (sub1 x))
(vector-ref #("a" "b") (- x 1))) (vector-ref #("a" "b") (- x 1)))
-String] -String]
[tc-err (string-append "bar" (if (zero? (ann 0.0 Float)) #f "foo"))]
) )
(test-suite (test-suite
"check-type tests" "check-type tests"

View File

@ -41,7 +41,8 @@
) )
;; numeric predicates ;; numeric predicates
[zero? (make-pred-ty (list N) B -Zero)] [zero? (asym-pred N B (-FS (-filter (Un -Flonum -Zero) 0)
(-not-filter -Zero 0)))]
[number? (make-pred-ty N)] [number? (make-pred-ty N)]
[integer? (asym-pred Univ B (-FS (-filter (Un -Integer -Flonum) 0) [integer? (asym-pred Univ B (-FS (-filter (Un -Integer -Flonum) 0)
(-not-filter -Integer 0)))] (-not-filter -Integer 0)))]