diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-05-04 10:05:57 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-05-04 10:05:57 +0000 |
commit | 2a0a747e57ec96bab9d4a6b7c0b32df82a41316e (patch) | |
tree | 002d92f89d7109abc1c2ebe7f113f8dee0dc3034 /stdio-common/printf_fp.c | |
parent | af5726aed8a0c87d7f29570641cf0acb6a92f918 (diff) |
Updated to fedora-glibc-20070504T0917cvs/fedora-glibc-2_5_90-22
Diffstat (limited to 'stdio-common/printf_fp.c')
-rw-r--r-- | stdio-common/printf_fp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c index 9b796eac2f..6e5ff5855b 100644 --- a/stdio-common/printf_fp.c +++ b/stdio-common/printf_fp.c @@ -793,7 +793,7 @@ ___printf_fp (FILE *fp, else { /* This is a special case. We don't need a factor because the - numbers are in the range of 0.0 <= fp < 8.0. We simply + numbers are in the range of 1.0 <= |fp| < 8.0. We simply shift it to the right place and divide it by 1.0 to get the leading digit. (Of course this division is not really made.) */ assert (0 <= exponent && exponent < 3 && @@ -1013,6 +1013,12 @@ ___printf_fp (FILE *fp, { *wstartp = '1'; exponent += expsign == 0 ? 1 : -1; + + /* The above exponent adjustment could lead to 1.0e-00, + e.g. for 0.999999999. Make sure exponent 0 always + uses + sign. */ + if (exponent == 0) + expsign = 0; } else if (intdig_no == dig_max) { |