From 4e9783b4366368ed370fd5ab377e9e23241420d6 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Sat, 9 Jun 2012 21:57:01 -0400 Subject: [PATCH] Be more conservative about returning Float-Complex and others. original commit: 7191ef5c744fc6ebc95a225913516e075a1bf151 --- .../base-env/base-env-numeric.rkt | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/collects/typed-racket/base-env/base-env-numeric.rkt b/collects/typed-racket/base-env/base-env-numeric.rkt index 8d65cf91..7edead0a 100644 --- a/collects/typed-racket/base-env/base-env-numeric.rkt +++ b/collects/typed-racket/base-env/base-env-numeric.rkt @@ -1677,12 +1677,10 @@ (-Real (Un -NegInt -PosInt) . -> . -Real) (-InexactReal -InexactReal . -> . (Un -InexactReal -InexactComplex)) (-ExactNumber -ExactNumber . -> . -ExactNumber) - (N -FloatComplex . -> . -FloatComplex) - (-FloatComplex (Un -InexactComplex -InexactReal -NegReal -PosReal) . -> . -FloatComplex) - ((Un -ExactNumber -SingleFlonum -SingleFlonumComplex) -SingleFlonumComplex . -> . -SingleFlonum) - (-SingleFlonumComplex (Un -NegRat -PosRat -SingleFlonum -SingleFlonumComplex) . -> . -SingleFlonum) - ((Un -ExactNumber -InexactReal -InexactComplex) -InexactComplex . -> . -InexactComplex) - (-InexactComplex (Un -NegRat -PosRat -InexactReal -InexactComplex) . -> . -InexactComplex) + (-FloatComplex (Un -InexactComplex -InexactReal) . -> . -FloatComplex) + (-SingleFlonumComplex (Un -SingleFlonum -SingleFlonumComplex) . -> . -SingleFlonumComplex) + ((Un -InexactReal -InexactComplex) -InexactComplex . -> . -InexactComplex) + (-InexactComplex (Un -InexactReal -InexactComplex) . -> . -InexactComplex) (N N . -> . N))] [sqrt (from-cases @@ -1694,8 +1692,8 @@ (-ExactNumber . -> . -ExactNumber) (-Flonum . -> . (Un -Flonum -FloatComplex)) (-FloatComplex . -> . -FloatComplex) - ((Un -SingleFlonumComplex -SingleFlonum) . -> . -SingleFlonumComplex) - ((Un -InexactComplex -InexactReal) . -> . -InexactComplex) + (-SingleFlonumComplex . -> . -SingleFlonumComplex) + (-InexactComplex . -> . -InexactComplex) (N . -> . N))] [integer-sqrt (from-cases @@ -1707,22 +1705,16 @@ -InexactRealPosZero -InexactRealNegZero -InexactRealZero -NonNegInexactReal -RealZero -NonNegReal)) (-Rat . -> . -ExactNumber) - (-Flonum . -> . -FloatComplex) ; defined on inexact integers too - (-SingleFlonum . -> . -SingleFlonumComplex) - (-InexactReal . -> . -InexactComplex) - (N . -> . N))] + (N . -> . N))] ; defined on inexact integers too [log (cl->* (-NonNegRat . -> . -Real) (-FlonumZero . -> . -NegFlonum) (-NonNegFlonum . -> . -Flonum) - (-Flonum . -> . (Un -Flonum -FloatComplex)) (-SingleFlonumZero . -> . -NegSingleFlonum) (-NonNegSingleFlonum . -> . -SingleFlonum) - (-SingleFlonum . -> . (Un -SingleFlonum -SingleFlonumComplex)) (-InexactRealZero . -> . -NegInexactReal) (-NonNegInexactReal . -> . -InexactReal) (-NonNegReal . -> . -Real) - (-ExactNumber . -> . (Un -ExactNumber -FloatComplex)) (-FloatComplex . -> . -FloatComplex) (-SingleFlonumComplex . -> . -SingleFlonumComplex) (-InexactComplex . -> . -InexactComplex)