From: Taylor R Campbell Date: Sun, 18 Nov 2018 03:58:40 +0000 (+0000) Subject: Respect signed zero in complex real part. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~34 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4f1444339cbf6308e036c0855508d8116b67e355;p=mit-scheme.git Respect signed zero in complex real part. --- 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))