From eb326dd443a08a4970f145ac79f000581db0385a Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Wed, 30 Jun 2010 14:19:53 -0400 Subject: [PATCH] Better types for modulo and remainder involving fixnums. original commit: adf5c8c030656026d70a627009a0655bd1546af7 --- collects/typed-scheme/private/base-env-numeric.rkt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/collects/typed-scheme/private/base-env-numeric.rkt b/collects/typed-scheme/private/base-env-numeric.rkt index 11e8414c..e42c0b77 100644 --- a/collects/typed-scheme/private/base-env-numeric.rkt +++ b/collects/typed-scheme/private/base-env-numeric.rkt @@ -163,8 +163,8 @@ [odd? (-> -Integer B : (-FS -top (-filter (-val 0) 0)))] [even? (-> -Integer B)] -[modulo (cl->* (-NonnegativeFixnum -NonnegativeFixnum . -> . -NonnegativeFixnum) - (-Fixnum -Fixnum . -> . -Fixnum) +[modulo (cl->* (-Nat -NonnegativeFixnum . -> . -NonnegativeFixnum) + (-Integer -Fixnum . -> . -Fixnum) (-Nat -Nat . -> . -Nat) (-Integer -Integer . -> . -Integer))] @@ -322,12 +322,14 @@ (-Fixnum -Fixnum . -> . -Fixnum) (-Nat -Nat . -> . -Nat) (-Integer -Integer . -> . -Integer))] -[remainder (cl->* (-NonnegativeFixnum -NonnegativeFixnum . -> . -NonnegativeFixnum) - (-Fixnum -Fixnum . -> . -Fixnum) +[remainder (cl->* (-Nat -NonnegativeFixnum . -> . -NonnegativeFixnum) + (-Integer -Fixnum . -> . -Fixnum) (-Nat -Nat . -> . -Nat) (-Integer -Integer . -> . -Integer))] [quotient/remainder (cl->* (-NonnegativeFixnum -NonnegativeFixnum . -> . (-values (list -NonnegativeFixnum -NonnegativeFixnum))) + (-Nat -NonnegativeFixnum . -> . (-values (list -Nat -NonnegativeFixnum))) (-Fixnum -Fixnum . -> . (-values (list -Fixnum -Fixnum))) + (-Integer -Fixnum . -> . (-values (list -Integer -Fixnum))) (-Nat -Nat . -> . (-values (list -Nat -Nat))) (-Integer -Integer . -> . (-values (list -Integer -Integer))))]