Chez Scheme: Avoid division by 0 in complex /.

Closes #3821.
This commit is contained in:
Sam Tobin-Hochstadt 2021-05-06 15:48:19 -04:00 committed by Sam Tobin-Hochstadt
parent 0bad9d5d8c
commit abfa49d7d9

View File

@ -2762,7 +2762,7 @@
(/ (- (* b c) (* a d)) t))))
;; Let r = c/d or d/c, depending on which is larger
(cond
[(and ($exactnum? x) ($exactnum? y))
[(or (eq? c 0) (and ($exactnum? x) ($exactnum? y)))
(simpler-divide a b c d)]
[(< (abs c) (abs d))
(let ([r (/ d c)])