diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-07-28 22:39:04 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-07-28 22:39:04 +0000 |
commit | b113c12c350c29a0f7f06fba12f06d86e79de1f4 (patch) | |
tree | b42569c0a1afb8ea9358239ceecb64834c6c038d /misc/efgcvt_r.c | |
parent | aa847ee5a48c4dc582960b1ee575a82cab005a01 (diff) | |
download | glibc-b113c12c350c29a0f7f06fba12f06d86e79de1f4.zip glibc-b113c12c350c29a0f7f06fba12f06d86e79de1f4.tar.gz glibc-b113c12c350c29a0f7f06fba12f06d86e79de1f4.tar.bz2 |
Update.
1999-07-28 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt.c: Use IEEE 854 formula to compute the number of digits
to print.
* misc/efgcvt_r.c: Likewise.
* misc/qefgcvt.c: Likewise.
* misc/qefgcvt_r.c: Likewise.
* misc/tst-efgcvt.c: Remove one test which cannot reliably be run
anymore.
Diffstat (limited to 'misc/efgcvt_r.c')
-rw-r--r-- | misc/efgcvt_r.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/misc/efgcvt_r.c b/misc/efgcvt_r.c index 944fe4c..d73fd22 100644 --- a/misc/efgcvt_r.c +++ b/misc/efgcvt_r.c @@ -30,7 +30,12 @@ # define FUNC_PREFIX # define FLOAT_FMT_FLAG # define FLOAT_NAME_EXT -# define NDIGIT_MAX DBL_DIG +# if DBL_MANT_DIG == 53 +# define NDIGIT_MAX 17 +# else +/* See IEEE 854 5.6, table 2 for this formula. */ +# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * DBL_MANT_DIG + 1.0))) +# endif #endif #define APPEND(a, b) APPEND2 (a, b) |