From 2fd1e3ac9ffc0b939cceac0e7ded9093d5e7a9a8 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Wed, 9 Jun 2010 12:45:00 -0400 Subject: [PATCH] Modified the numeric base type environment. --- .../typed-scheme/private/base-env-numeric.rkt | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/collects/typed-scheme/private/base-env-numeric.rkt b/collects/typed-scheme/private/base-env-numeric.rkt index 163115bf1d..daf5aacbc1 100644 --- a/collects/typed-scheme/private/base-env-numeric.rkt +++ b/collects/typed-scheme/private/base-env-numeric.rkt @@ -78,16 +78,38 @@ [> real-comp] -[* (apply cl->* (for/list ([t all-num-types]) (->* (list) t t)))] -[+ (apply cl->* (for/list ([t all-num-types]) (->* (list) t t)))] +[* (apply cl->* + (append (for/list ([t (list -Pos -Nat -Integer -ExactRational -Flonum)]) (->* (list) t t)) + (list (->* (list (Un -Integer -ExactRational -Real -Flonum)) + (Un -Integer -ExactRational -Real -Flonum) + -Flonum)) + (list (->* (list) -Real -Real)) + (list (->* (list) N N))))] +[+ (apply cl->* + (append (for/list ([t (list -Pos -Nat -Integer -ExactRational -Flonum)]) (->* (list) t t)) + (list (->* (list (Un -Integer -ExactRational -Real -Flonum)) + (Un -Integer -ExactRational -Real -Flonum) + -Flonum)) + (list (->* (list) -Real -Real)) + (list (->* (list) N N))))] -[- (apply cl->* - (for/list ([t (list -Integer -ExactRational -Flonum -Real N)]) - (->* (list t) t t)))] -[/ (apply cl->* - (->* (list -Integer) -Integer -ExactRational) - (for/list ([t (list -ExactRational -Flonum -Real N)]) - (->* (list t) t t)))] +[- (apply cl->* + (append (for/list ([t (list -Integer -ExactRational -Flonum)]) + (->* (list t) t t)) + (list (->* (list (Un -Integer -ExactRational -Real -Flonum)) + (Un -Integer -ExactRational -Real -Flonum) + -Flonum)) + (list (->* (list -Real) -Real -Real)) + (list (->* (list N) N N))))] +[/ (apply cl->* + (append (list (->* (list -Integer) -Integer -ExactRational)) + (for/list ([t (list -ExactRational -Flonum)]) + (->* (list t) t t)) + (list (->* (list (Un -Integer -ExactRational -Real -Flonum)) + (Un -Integer -ExactRational -Real -Flonum) + -Flonum)) + (list (->* (list -Real) -Real -Real)) + (list (->* (list N) N N))))] [max (apply cl->* (->* (list -Pos) -Integer -Pos) (->* (list -Nat) -Integer -Nat) (for/list ([t all-num-types]) (->* (list t) t t)))] [min (apply cl->* (for/list ([t all-num-types]) (->* (list t) t t)))] @@ -137,7 +159,8 @@ [denominator (-Real . -> . -Real)] [rationalize (-Real -Real . -> . N)] [expt (cl->* (-Nat -Nat . -> . -Nat) - (-Integer -Integer . -> . -Integer) + (-Integer -Nat . -> . -Integer) + (-Real -Integer . -> . -Real) (N N . -> . N))] [sqrt (cl->* (-Nat . -> . -Real)