From daed58e27ca950ad738128bbb47c50c2c6104d2e Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 16 Nov 2018 09:09:40 +0000 Subject: [PATCH] Fix case that wasn't adequately exercised. --- src/runtime/numpar.scm | 11 ++++++----- tests/runtime/test-numpar.scm | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/runtime/numpar.scm b/src/runtime/numpar.scm index d3f5ce8cb..4f78bcec6 100644 --- a/src/runtime/numpar.scm +++ b/src/runtime/numpar.scm @@ -245,7 +245,7 @@ USA. integer rexponent exactness radix sign 2))) (else (parse-dotted-5 string start end integer rexponent exactness radix - sign)))) + sign 10 0)))) (define (parse-exponent-1 string start end integer rexponent exactness radix sign base) @@ -268,8 +268,8 @@ USA. (let ((bexponent (if (eq? #\- esign) (- eint) eint))) (if (fix:= start end) (finish-real integer rexponent exactness radix sign base bexponent) - (parse-decimal-5 string start end integer rexponent exactness radix - sign base bexponent)))) + (parse-dotted-5 string start end integer rexponent exactness radix + sign base bexponent)))) (and (fix:< start end) (let ((esign (string-ref string start))) @@ -278,9 +278,10 @@ USA. (get-digits start #f))))) (define (parse-dotted-5 string start end integer rexponent exactness radix - sign) + sign base bexponent) (parse-complex string start end - (finish-real integer rexponent exactness radix sign 10 0) + (finish-real integer rexponent exactness radix sign + base bexponent) exactness radix sign)) (define (parse-complex string start end real exactness radix sign) diff --git a/tests/runtime/test-numpar.scm b/tests/runtime/test-numpar.scm index a2641421c..e366aa8d3 100644 --- a/tests/runtime/test-numpar.scm +++ b/tests/runtime/test-numpar.scm @@ -85,7 +85,7 @@ USA. (define-eqv-test "#d#e-100" -100) (define-eqv-test "#x#e-100" -256) -(define-eqv-test "#e1e1+1e1i" 10+10i 'xerror) +(define-eqv-test "#e1e1+1e1i" 10+10i) (define-eqv-test "#e#x1p10" (expt 2 10)) (define-eqv-test "#e#x1.1p4" #x11) -- 2.25.1