From 3660ea15c51e8b4b37b4ff3ac60d0e7b834e0f84 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 18 Feb 1991 11:43:44 +0000 Subject: [PATCH] One less significant digit: 20 was too much --- modules/src/flt_arith/flt_str2fl.c | 2 +- modules/src/flt_arith/test.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/src/flt_arith/flt_str2fl.c b/modules/src/flt_arith/flt_str2fl.c index 11551ff6a..5ef842246 100644 --- a/modules/src/flt_arith/flt_str2fl.c +++ b/modules/src/flt_arith/flt_str2fl.c @@ -425,7 +425,7 @@ flt_flt2str(e, buf, bufsize) char *buf; { -#define NDIG 20 +#define NDIG 19 int sign, dp; register int i; register char *s1; diff --git a/modules/src/flt_arith/test.c b/modules/src/flt_arith/test.c index cc50c942d..35904edbe 100644 --- a/modules/src/flt_arith/test.c +++ b/modules/src/flt_arith/test.c @@ -5,17 +5,17 @@ struct tests { int oper; char *result; } tests[] = { - { "1.0", 0, 0, "1.0000000000000000000" }, - { "-1.0", 0, 0, "-1.0000000000000000000" }, - { "0.0", 0, 0, "0.0000000000000000000" }, - { "1.234567", 0, 0, "1.2345670000000000000" }, - { "1.234567", 0, 'D', "1.0000000000000000000" }, - { "1.234567", 0, 'R', "2.3456700000000000000e-1" }, - { "32768", "32768", '+', "6.5536000000000000000e+4" }, - { "32768", "32767", '-', "1.0000000000000000000" }, - { "32768", "32768", '*', "1.0737418240000000000e+9" }, - { "32768", "32768", '/', "1.0000000000000000000" }, - { "1.234567e20", "-1.234567e20", '+', "0.0000000000000000000" }, + { "1.0", 0, 0, "1.000000000000000000" }, + { "-1.0", 0, 0, "-1.000000000000000000" }, + { "0.0", 0, 0, "0.000000000000000000" }, + { "1.234567", 0, 0, "1.234567000000000000" }, + { "1.234567", 0, 'D', "1.000000000000000000" }, + { "1.234567", 0, 'R', "2.345670000000000000e-1" }, + { "32768", "32768", '+', "6.553600000000000000e+4" }, + { "32768", "32767", '-', "1.000000000000000000" }, + { "32768", "32768", '*', "1.073741824000000000e+9" }, + { "32768", "32768", '/', "1.000000000000000000" }, + { "1.234567e20", "-1.234567e20", '+', "0.000000000000000000" }, { 0, 0, 0, 0} }; -- 2.34.1