From abfbdde177c3a7155070dda1b2cdc8292054cc26 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 14 Jul 1999 00:54:57 +0000 Subject: Update. --- stdio-common/printf_fp.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'stdio-common/printf_fp.c') diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c index 1b550abe4f..0a2efb7891 100644 --- a/stdio-common/printf_fp.c +++ b/stdio-common/printf_fp.c @@ -439,9 +439,28 @@ __printf_fp (FILE *fp, { if (scalesize == 0) { - tmpsize = powers->arraysize; - memcpy (tmp, &__tens[powers->arrayoff], - tmpsize * sizeof (mp_limb_t)); +#ifndef __NO_LONG_DOUBLE_MATH + if (LDBL_MANT_DIG > _FPIO_CONST_OFFSET * BITS_PER_MP_LIMB + && info->is_long_double) + { +#define _FPIO_CONST_SHIFT \ + (((LDBL_MANT_DIG + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB) \ + - _FPIO_CONST_OFFSET) + /* 64bit const offset is not enough for + IEEE quad long double. */ + tmpsize = powers->arraysize + _FPIO_CONST_SHIFT; + memcpy (tmp + _FPIO_CONST_SHIFT, + &__tens[powers->arrayoff], + tmpsize * sizeof (mp_limb_t)); + MPN_ZERO (tmp, _FPIO_CONST_SHIFT); + } + else +#endif + { + tmpsize = powers->arraysize; + memcpy (tmp, &__tens[powers->arrayoff], + tmpsize * sizeof (mp_limb_t)); + } } else { -- cgit v1.2.3