One less significant digit: 20 was too much

This commit is contained in:
ceriel 1991-02-18 11:43:44 +00:00
parent cf0cd51810
commit 3660ea15c5
2 changed files with 12 additions and 12 deletions

View file

@ -425,7 +425,7 @@ flt_flt2str(e, buf, bufsize)
char *buf; char *buf;
{ {
#define NDIG 20 #define NDIG 19
int sign, dp; int sign, dp;
register int i; register int i;
register char *s1; register char *s1;

View file

@ -5,17 +5,17 @@ struct tests {
int oper; int oper;
char *result; char *result;
} tests[] = { } tests[] = {
{ "1.0", 0, 0, "1.0000000000000000000" }, { "1.0", 0, 0, "1.000000000000000000" },
{ "-1.0", 0, 0, "-1.0000000000000000000" }, { "-1.0", 0, 0, "-1.000000000000000000" },
{ "0.0", 0, 0, "0.0000000000000000000" }, { "0.0", 0, 0, "0.000000000000000000" },
{ "1.234567", 0, 0, "1.2345670000000000000" }, { "1.234567", 0, 0, "1.234567000000000000" },
{ "1.234567", 0, 'D', "1.0000000000000000000" }, { "1.234567", 0, 'D', "1.000000000000000000" },
{ "1.234567", 0, 'R', "2.3456700000000000000e-1" }, { "1.234567", 0, 'R', "2.345670000000000000e-1" },
{ "32768", "32768", '+', "6.5536000000000000000e+4" }, { "32768", "32768", '+', "6.553600000000000000e+4" },
{ "32768", "32767", '-', "1.0000000000000000000" }, { "32768", "32767", '-', "1.000000000000000000" },
{ "32768", "32768", '*', "1.0737418240000000000e+9" }, { "32768", "32768", '*', "1.073741824000000000e+9" },
{ "32768", "32768", '/', "1.0000000000000000000" }, { "32768", "32768", '/', "1.000000000000000000" },
{ "1.234567e20", "-1.234567e20", '+', "0.0000000000000000000" }, { "1.234567e20", "-1.234567e20", '+', "0.000000000000000000" },
{ 0, 0, 0, 0} { 0, 0, 0, 0}
}; };