From 11b0166100a9bbf6fd78b58ae06bff69961c1d60 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Sat, 9 Jun 2012 22:04:43 -0400 Subject: [PATCH] Subtraction is not commutative. original commit: 5d26fd10e64d792d033b93faad30245ad1d5090a --- collects/typed-racket/base-env/base-env-numeric.rkt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/collects/typed-racket/base-env/base-env-numeric.rkt b/collects/typed-racket/base-env/base-env-numeric.rkt index 7edead0a..97d8c452 100644 --- a/collects/typed-racket/base-env/base-env-numeric.rkt +++ b/collects/typed-racket/base-env/base-env-numeric.rkt @@ -655,7 +655,11 @@ (list (-> pos neg) (-> non-neg non-pos) (-> neg pos) - (-> non-pos non-neg))) + (-> non-pos non-neg) + (-> -Zero pos neg) + (-> -Zero non-neg non-pos) + (-> -Zero neg pos) + (-> -Zero non-pos non-neg))) ;Check to ensure we fail fast if the flonum bindings change @@ -1124,7 +1128,7 @@ (negation-pattern -PosSingleFlonum -NegSingleFlonum -NonNegSingleFlonum -NonPosSingleFlonum) (negation-pattern -PosInexactReal -NegInexactReal -NonNegInexactReal -NonPosInexactReal) (negation-pattern -PosReal -NegReal -NonNegReal -NonPosReal) - (map (lambda (t) (commutative-binop t -Zero t)) + (map (lambda (t) (-> t -Zero t)) (list -One -PosByte -Byte -PosIndex -Index -PosFixnum -NonNegFixnum -NegFixnum -NonPosFixnum -Fixnum)) (-> -One -One -Zero)