Respect signed zero in complex real part.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 18 Nov 2018 03:58:40 +0000 (03:58 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 18 Nov 2018 06:11:43 +0000 (06:11 +0000)
src/runtime/numpar.scm
tests/runtime/test-numpar.scm

index 6370d6a0ebc742d04c95a889365af4c8196ed3ce..c5da9fc5a17650e0dd2ea7ab40504da809d30d2c 100644 (file)
@@ -299,7 +299,7 @@ USA.
                      (parse-top-level string start end exactness radix)))
                 (and (complex? imaginary)
                      (= 0 (real-part imaginary))
-                     (+ real imaginary))))
+                     (make-rectangular real (imag-part imaginary)))))
              ((char=? #\@ char)
               (let ((angle
                      (parse-top-level string start+1 end exactness radix)))
index a819b51a65f0417b2d73b7d7873d7bff3e53accd..93b567b796960f86378417ee8dcf159447fca230 100644 (file)
@@ -131,5 +131,5 @@ USA.
 (define-eqv-test "0-2i" (make-rectangular 0 -2))
 (define-eqv-test "0.+2i" (make-rectangular +0. 2))
 (define-eqv-test "0.-2i" (make-rectangular +0. -2))
-(define-eqv-test "-0.+2i" (make-rectangular -0. 2) 'xfail)
-(define-eqv-test "-0.-2i" (make-rectangular -0. -2) 'xfail)
+(define-eqv-test "-0.+2i" (make-rectangular -0. 2))
+(define-eqv-test "-0.-2i" (make-rectangular -0. -2))