From 01ae1994ed162a03b2dbae47669e73dc097d20eb Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Tue, 27 Aug 2019 00:43:37 +0200 Subject: [PATCH] Fix dtoab. * lib/mes/dtoab.c (dtoab): Fix it. * lib/tests/mes/90-dtoab.c (main): Fix test. * build-aux/check-mescc.sh (XFAIL_TESTS: Remove it. --- build-aux/check-mescc.sh | 7 +------ lib/mes/dtoab.c | 2 +- lib/tests/mes/90-dtoab.c | 2 +- lib/tests/mes/90-dtoab.stdout | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/build-aux/check-mescc.sh b/build-aux/check-mescc.sh index eec0e4ec..f060da67 100755 --- a/build-aux/check-mescc.sh +++ b/build-aux/check-mescc.sh @@ -253,12 +253,6 @@ lib/tests/scaffold/a0-call-trunc-int.c fi fi -if test $mes_cpu = x86; then - XFAIL_TESTS="$XFAIL_TESTS -lib/tests/mes/90-dtoab.c -" -fi - if test $mes_cpu = x86_64; then XFAIL_TESTS="$XFAIL_TESTS lib/tests/stdio/70-printf-stdarg.c @@ -272,6 +266,7 @@ lib/tests/mes/90-abtod.c if test $mes_cpu = x86; then XFAIL_TESTS="$XFAIL_TESTS +lib/tests/mes/90-dtoab.c " fi diff --git a/lib/mes/dtoab.c b/lib/mes/dtoab.c index dc190503..effaf9be 100644 --- a/lib/mes/dtoab.c +++ b/lib/mes/dtoab.c @@ -29,7 +29,7 @@ dtoab (double d, int base, int signed_p) long i = (long) d; char *p = ntoab (i, base, signed_p); strcpy (dtoa_buf, p); - long f = (d - (double) i) * (double) 100000000000; + long f = (d - (double) i) * (double) 100000000; if (f) { if (f < 0) diff --git a/lib/tests/mes/90-dtoab.c b/lib/tests/mes/90-dtoab.c index 1f7e29d1..f6c1268d 100644 --- a/lib/tests/mes/90-dtoab.c +++ b/lib/tests/mes/90-dtoab.c @@ -28,7 +28,7 @@ main () char *p = dtoab (d, 10, 1); puts (p); - d = -3.141592653589; + d = -3.14159265; p = dtoab (d, 10, 1); puts (p); diff --git a/lib/tests/mes/90-dtoab.stdout b/lib/tests/mes/90-dtoab.stdout index 88609219..e9ef95b2 100644 --- a/lib/tests/mes/90-dtoab.stdout +++ b/lib/tests/mes/90-dtoab.stdout @@ -1,2 +1,2 @@ 1.23 --3.14159265358 +-3.14159265