Make abs return its argument on -NonNegReal.
This commit is contained in:
parent
a522768b7e
commit
f0c48cfb87
|
@ -665,19 +665,16 @@
|
|||
|
||||
(define abs-cases ; used both for abs and magnitude
|
||||
(list
|
||||
(map unop (list -Zero -One -PosByte -Byte -PosIndex -Index -PosFixnum -NonNegFixnum))
|
||||
(-NonNegReal . -> . -NonNegReal : -true-filter : (-arg-path 0))
|
||||
;; abs may not be closed on fixnums. (abs min-fixnum) is not a fixnum
|
||||
((Un -PosInt -NegInt) . -> . -PosInt)
|
||||
(-Int . -> . -Nat)
|
||||
((Un -PosRat -NegRat) . -> . -PosRat)
|
||||
(-Rat . -> . -NonNegRat)
|
||||
(-FlonumZero . -> . -FlonumZero)
|
||||
((Un -PosFlonum -NegFlonum) . -> . -PosFlonum)
|
||||
(-Flonum . -> . -NonNegFlonum)
|
||||
(-SingleFlonumZero . -> . -SingleFlonumZero)
|
||||
((Un -PosSingleFlonum -NegSingleFlonum) . -> . -PosSingleFlonum)
|
||||
(-SingleFlonum . -> . -NonNegSingleFlonum)
|
||||
(-InexactRealZero . -> . -InexactRealZero)
|
||||
((Un -PosInexactReal -NegInexactReal) . -> . -PosInexactReal)
|
||||
(-InexactReal . -> . -NonNegInexactReal)
|
||||
((Un -PosReal -NegReal) . -> . -PosReal)
|
||||
|
|
|
@ -444,7 +444,7 @@
|
|||
(tc-e (sinh (ann 0 Nonpositive-Integer)) -NonPosReal)
|
||||
(tc-e (angle -1) (t:Un -InexactReal -Zero))
|
||||
(tc-e (angle 2.3) -Zero)
|
||||
(tc-e (magnitude 3/4) -PosRat)
|
||||
(tc-e/t (magnitude 3/4) -PosRat)
|
||||
(tc-e (magnitude 3+2i) -NonNegReal)
|
||||
(tc-e (min (ann 3 Fixnum) (ann 3 Fixnum)) -Fixnum)
|
||||
(tc-e (min (ann -2 Negative-Fixnum) (ann 3 Fixnum)) -NegFixnum)
|
||||
|
@ -3631,6 +3631,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]
|
||||
)
|
||||
|
||||
(test-suite
|
||||
|
|
Loading…
Reference in New Issue
Block a user