Commit eb0857bf authored by pfdietz's avatar pfdietz
Browse files

Fixed signed zero bug in test minus.6, spotted by Gerd Moellman.

parent ee6d1507
......@@ -61,7 +61,7 @@
(float 1.0s0 (realpart neg)))
(or (/= neg (- 0 x))
(and (not (zerop (realpart x)))
(not (eql neg (- 0 x))))))
(not (eqlzt neg (- 0 x))))))
collect x)
nil)
......
......@@ -5,6 +5,17 @@
(in-package :cl-test)
(defun eqlzt (x y)
"Return T if (eql x y) or if both are zero of the same type."
(cond
((complexp x)
(and (complexp y)
(eqlzt (realpart x) (realpart y))
(eqlzt (imagpart x) (imagpart y))))
((zerop x)
(eqlt (abs x) (abs y)))
(t (eqlt x y))))
(defun numbers-are-compatible (x y)
(cond
((complexp x)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment