From 6235faaba1859145e9ed71eeade5ced61b614e80 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 7 Dec 2018 04:42:29 +0000 Subject: [PATCH] Fix sign of NaN in reader. --- 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 c5da9fc5a..1c65a9e7a 100644 --- a/src/runtime/numpar.scm +++ b/src/runtime/numpar.scm @@ -120,7 +120,7 @@ USA. ((and (char-ci=? #\n char) (string-prefix-ci? "an.0" string start end)) (parse-complex string (+ start 4) end - (flo:nan.0) + (apply-sign sign (flo:nan.0)) exactness radix sign)) ((i? char) (and (fix:= start end) diff --git a/tests/runtime/test-numpar.scm b/tests/runtime/test-numpar.scm index 534680696..aa3bc16f5 100644 --- a/tests/runtime/test-numpar.scm +++ b/tests/runtime/test-numpar.scm @@ -167,12 +167,12 @@ USA. (define-eqv-test "-2-0.i" (make-rectangular -2 -0.)) (define-eqv-test "+nan.0" (flo:make-nan #f #t 0)) -(define-eqv-test "-nan.0" (flo:make-nan #t #t 0) expect-failure) +(define-eqv-test "-nan.0" (flo:make-nan #t #t 0)) (define-eqv-test "+inf.0" (flo:+inf.0)) (define-eqv-test "-inf.0" (flo:-inf.0)) (define-eqv-test "#i+nan.0" (flo:make-nan #f #t 0)) -(define-eqv-test "#i-nan.0" (flo:make-nan #t #t 0) expect-failure) +(define-eqv-test "#i-nan.0" (flo:make-nan #t #t 0)) (define-eqv-test "#i+inf.0" (flo:+inf.0)) (define-eqv-test "#i-inf.0" (flo:-inf.0)) -- 2.25.1