From 990fa87a2eba6b531557c623a4b5c5b4a893313b Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Tue, 19 Mar 2013 16:59:31 -0400 Subject: [PATCH] Add random testing for complexes. Fix a bug it found. --- collects/tests/typed-racket/tr-random-testing.rkt | 2 ++ collects/typed-racket/base-env/base-env-numeric.rkt | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/collects/tests/typed-racket/tr-random-testing.rkt b/collects/tests/typed-racket/tr-random-testing.rkt index 5d784ca857..f1bba93ca1 100644 --- a/collects/tests/typed-racket/tr-random-testing.rkt +++ b/collects/tests/typed-racket/tr-random-testing.rkt @@ -175,6 +175,8 @@ (sin E*) (tan E*) (sqr E*) + (make-rectangular E* E*) + (make-polar E* E*) ]) ;; generated from: (map car (file->list "base-env-parts")) diff --git a/collects/typed-racket/base-env/base-env-numeric.rkt b/collects/typed-racket/base-env/base-env-numeric.rkt index 64ae89644f..742eedbc3c 100644 --- a/collects/typed-racket/base-env/base-env-numeric.rkt +++ b/collects/typed-racket/base-env/base-env-numeric.rkt @@ -1610,8 +1610,9 @@ [round (round-type)] [make-rectangular (cl->* (-Rat -Rat . -> . -ExactNumber) - (-Flonum -Real . -> . -FloatComplex) - (-Real -Flonum . -> . -FloatComplex) + (-Flonum -Flonum . -> . -FloatComplex) + (-Flonum (Un -PosReal -NegReal) . -> . -FloatComplex) ; no exact 0 + ((Un -PosReal -NegReal) -Flonum . -> . -FloatComplex) (-SingleFlonum -SingleFlonum . -> . -SingleFlonumComplex) (-InexactReal -InexactReal . -> . -InexactComplex) (-Real -Real . -> . N))]