Imaginaries can't be inexact complexes.
original commit: bce003fa1813b309382d6af01090f3cb5b9f84d5
This commit is contained in:
parent
6e1c0a9ca5
commit
f51d1e640d
|
@ -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?)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user