From 4f1444339cbf6308e036c0855508d8116b67e355 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 18 Nov 2018 03:58:40 +0000 Subject: [PATCH] Respect signed zero in complex real part. --- src/runtime/numpar.scm | 2 +- tests/runtime/test-numpar.scm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/numpar.scm b/src/runtime/numpar.scm index 6370d6a0e..c5da9fc5a 100644 --- a/src/runtime/numpar.scm +++ b/src/runtime/numpar.scm @@ -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))) diff --git a/tests/runtime/test-numpar.scm b/tests/runtime/test-numpar.scm index a819b51a6..93b567b79 100644 --- a/tests/runtime/test-numpar.scm +++ b/tests/runtime/test-numpar.scm @@ -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)) -- 2.25.1