From b113c12c350c29a0f7f06fba12f06d86e79de1f4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 28 Jul 1999 22:39:04 +0000 Subject: Update. 1999-07-28 Ulrich Drepper * 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. --- misc/qefgcvt_r.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'misc/qefgcvt_r.c') diff --git a/misc/qefgcvt_r.c b/misc/qefgcvt_r.c index 012ab54acc..5ff8110e3b 100644 --- a/misc/qefgcvt_r.c +++ b/misc/qefgcvt_r.c @@ -18,10 +18,17 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include + #define FLOAT_TYPE long double #define FUNC_PREFIX q #define FLOAT_FMT_FLAG "L" #define FLOAT_NAME_EXT l -# define NDIGIT_MAX LDBL_DIG +#if LDBL_MANT_DIG == 64 +# define NDIGIT_MAX 21 +#else +/* See IEEE 854 5.6, table 2 for this formula. */ +# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * LDBL_MANT_DIG + 1.0))) +#endif #include "efgcvt_r.c" -- cgit v1.2.3