Skip to content
Snippets Groups Projects
Commit 38526297 authored by pfdietz's avatar pfdietz
Browse files

More fixes of incompatible float/rational comparisons.

parent 9dfc672d
No related branches found
No related tags found
No related merge requests found
......@@ -153,19 +153,21 @@
(loop for x in *reals*
nconc
(loop for y in *reals*
for m = (max x y)
unless (and (>= m x) (>= m y)
(or (= m x) (= m y)))
collect (list x y m))))
when (numbers-are-compatible x y)
unless (let ((m (max x y)))
(and (>= m x) (>= m y)
(or (= m x) (= m y))))
collect (list x y (max x y)))))
(defun min.2-fn ()
(loop for x in *reals*
nconc
(loop for y in *reals*
for m = (min x y)
unless (and (<= m x) (<= m y)
(or (= m x) (= m y)))
collect (list x y m))))
when (numbers-are-compatible x y)
unless (let ((m (min x y)))
(and (<= m x) (<= m y)
(or (= m x) (= m y))))
collect (list x y (min x y)))))
(defun random-nonnegative-real ()
(if (coin 3)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment