From 6a8c366210e4d0e4c6891cfdd3a5b83b3e74efcd Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Wed, 25 Nov 2015 17:33:00 -0600 Subject: [PATCH] Fix type of `expt` to reflect fix to dynamic behavior. --- .../typed-racket/base-env/base-env-numeric.rkt | 2 +- typed-racket-test/unit-tests/typecheck-tests.rkt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt b/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt index 62befab4..13e91ed6 100644 --- a/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt +++ b/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt @@ -1628,7 +1628,7 @@ (-NonNegReal -Fixnum . -> . -Real) (-InexactReal (Un -NegFixnum -PosFixnum) . -> . -InexactReal) (-InexactReal -InexactReal . -> . (Un -InexactReal -InexactComplex)) - (-Real -Fixnum . -> . -Real) + (-Real -Integer . -> . -Real) (-FloatComplex -FloatComplex . -> . -FloatComplex) (-FloatComplex -Flonum . -> . (Un -FloatComplex -Flonum)) (-FloatComplex -InexactReal . -> . (Un -FloatComplex -InexactReal)) diff --git a/typed-racket-test/unit-tests/typecheck-tests.rkt b/typed-racket-test/unit-tests/typecheck-tests.rkt index 9882736b..3c9c3d1c 100644 --- a/typed-racket-test/unit-tests/typecheck-tests.rkt +++ b/typed-racket-test/unit-tests/typecheck-tests.rkt @@ -416,8 +416,8 @@ (tc-e (expt 0.5 2) (t:Un -NonNegFlonum -One)) (tc-e (expt 0.5 0) -One) (tc-e (expt -1/2 -1/2) -Number) - (tc-e (expt (ann 0.5 Float) (ann 2 Integer)) -Number) - (tc-e (expt (ann 0.5f0 Single-Flonum) (ann 2 Integer)) -Number) + (tc-e (expt (ann 0.5 Float) (ann 2 Integer)) -Real) + (tc-e (expt (ann 0.5f0 Single-Flonum) (ann 2 Integer)) -Real) (tc-e (expt (*) -0.0) (t:Un -NonNegFlonum -One)) (tc-e (expt (*) 2.4521075152139656e-300) (t:Un -NonNegFlonum -One)) (tc-e (expt (*) -0.0) (t:Un -NonNegFlonum -One)) @@ -433,7 +433,7 @@ (tc-e (expt (tan (real->double-flonum 6)) (lcm (*) (exact-round -1.7976931348623153e+308) 6)) - -Number) + -Real) (tc-e (exact->inexact (expt 10 (/ -120.0 20))) ; from rsound -NonNegInexactReal) (tc-e (flexpt 0.5 0.3) -NonNegFlonum) @@ -459,7 +459,7 @@ (tc-e (bitwise-and (exact-round 1.7976931348623157e+308) (exact-round -29)) -Int) (tc-e (flexpt -0.0 -1.0) -Flonum) (tc-e (expt -0.0f0 -3.0) (t:Un -InexactReal -InexactComplex)) - (tc-e (expt -8.665778974912815f+107 -677460115195106837726964554590085563061636191189747) -Number) + (tc-e (expt -8.665778974912815f+107 -677460115195106837726964554590085563061636191189747) -Real) (tc-e (expt (sin +inf.f) +nan.0+nan.0i) -Number) (tc-e (/ (gcd 1 0) -0.0f0 2.718281828459045) -Real) (tc-e (expt (make-polar (floor 6.468476f+31) (tanh +nan.f)) +nan.0) -Number)