mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-15 17:07:34 +02:00
The imaginary part of a non-complex is exact 0.
This commit is contained in:
parent
e4b86a5807
commit
11cdc6930d
1 changed files with 1 additions and 1 deletions
|
@ -1080,7 +1080,7 @@
|
|||
(cond-expand
|
||||
(complex
|
||||
(define (real-part z) (if (%complex? z) (complex-real z) z))
|
||||
(define (imag-part z) (if (%complex? z) (complex-imag z) 0.0))
|
||||
(define (imag-part z) (if (%complex? z) (complex-imag z) 0))
|
||||
(define (magnitude z)
|
||||
(sqrt (+ (* (real-part z) (real-part z))
|
||||
(* (imag-part z) (imag-part z)))))
|
||||
|
|
Loading…
Add table
Reference in a new issue