fixes from doug currie when complex support not compiled in

This commit is contained in:
Alex Shinn 2011-09-03 14:58:30 +09:00
parent 5f7a38da19
commit 5d92523bf4

View file

@ -894,7 +894,9 @@
(cond-expand (cond-expand
(complex (complex
(define (exact-complex? x) (define (exact-complex? x)
(and (%complex? x) (exact? (complex-real x)) (exact? (complex-imag x)))))) (and (%complex? x) (exact? (complex-real x)) (exact? (complex-imag x)))))
(else
(define (exact-complex? x) #f)))
(cond-expand (cond-expand
(ratios (ratios
@ -993,7 +995,7 @@
(* (imag-part z) (imag-part z))))) (* (imag-part z) (imag-part z)))))
(define (angle z) (atan (imag-part z) (real-part z))) (define (angle z) (atan (imag-part z) (real-part z)))
(define (make-rectangular x y) (define (make-rectangular x y)
(+ x (* z 0+1i))) (+ x (* z (sqrt -1))))
(define (make-polar r phi) (define (make-polar r phi)
(make-rectangular (* r (cos phi)) (* r (sin phi))))) (make-rectangular (* r (cos phi)) (* r (sin phi)))))
(else (else