From f51d1e640d49b2ac5dd40d834da307db0e55d845 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Tue, 3 Aug 2010 13:53:46 -0400 Subject: [PATCH] Imaginaries can't be inexact complexes. original commit: bce003fa1813b309382d6af01090f3cb5b9f84d5 --- collects/typed-scheme/types/abbrev.rkt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/collects/typed-scheme/types/abbrev.rkt b/collects/typed-scheme/types/abbrev.rkt index fca12fa8..6f9ad4e4 100644 --- a/collects/typed-scheme/types/abbrev.rkt +++ b/collects/typed-scheme/types/abbrev.rkt @@ -154,13 +154,17 @@ ;; Numeric hierarchy (define -Number (make-Base 'Number #'number?)) -;; a complex number can't have an inexact imaginary part and an exact real part -(define -InexactComplex (make-Base 'InexactComplex #'(and/c number? (lambda (x) (inexact-real? (imag-part x)))))) +(define -InexactComplex (make-Base 'InexactComplex + #'(and/c number? + (lambda (x) + (and (inexact-real? (imag-part x)) + (inexact-real? (real-part x))))))) (define -Flonum (make-Base 'Flonum #'inexact-real?)) -(define -NonnegativeFlonum (make-Base 'Nonnegative-Flonum #'(and/c inexact-real? - (or/c positive? zero?) - (lambda (x) (not (eq? x -0.0)))))) +(define -NonnegativeFlonum (make-Base 'Nonnegative-Flonum + #'(and/c inexact-real? + (or/c positive? zero?) + (lambda (x) (not (eq? x -0.0)))))) (define -ExactRational (make-Base 'Exact-Rational #'(and/c number? rational? exact?)))