Make type of abs and magnitude more precise.

Fixes a failing test.
This commit is contained in:
Vincent St-Amour 2015-06-16 11:18:46 -05:00
parent 0498f548c1
commit 6bef6e6ca8
2 changed files with 3 additions and 1 deletions

View File

@ -654,6 +654,8 @@
(list
;; abs is not the identity on negative zeros.
((Un -Zero -PosReal) . -> . (Un -Zero -PosReal) : -true-filter : (-arg-path 0))
;; but we know that we at least get *some* zero, and that it preserves exactness
(map unop (list -FlonumZero -SingleFlonumZero -RealZero))
;; abs may not be closed on fixnums. (abs min-fixnum) is not a fixnum
((Un -PosInt -NegInt) . -> . -PosInt)
(-Int . -> . -Nat)

View File

@ -3638,7 +3638,7 @@
[tc-e/t ((inst values Any) "a") -String]
[tc-e ((inst second Any Any Any) (list "a" "b")) -String]
[tc-e/t (abs 4) -PosByte]
[tc-e (abs -0.0) -NonNegFlonum]
[tc-e (abs -0.0) -FlonumZero]
;; PR 125: Tests for flonum predicate typechecking
[tc-e/t