Skip to content

Commit

Permalink
Chez Scheme: Avoid division by 0 in complex /.
Browse files Browse the repository at this point in the history
Closes racket#3821.
  • Loading branch information
samth committed May 20, 2021
1 parent 0bad9d5 commit abfa49d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion racket/src/ChezScheme/s/5_3.ss
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand Down

0 comments on commit abfa49d

Please sign in to comment.