diff options
author | Tobias Burnus <burnus@net-b.de> | 2012-11-23 23:11:40 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-11-23 23:11:40 +0100 |
commit | 05abb346d6b987349780c79e45530d88fcebccf4 (patch) | |
tree | f676fe7bb615062ab0007c6d0428c43bc9f80712 /libquadmath/printf/fpioconst.h | |
parent | aa66b299c8e766fb453279b55efcdd64d4ef360c (diff) | |
download | gcc-05abb346d6b987349780c79e45530d88fcebccf4.zip gcc-05abb346d6b987349780c79e45530d88fcebccf4.tar.gz gcc-05abb346d6b987349780c79e45530d88fcebccf4.tar.bz2 |
quadmath-rounding-mode.h: New.
2012-11-23 Tobias Burnus <burnus@net-b.de>
Joseph Myers <joseph@codesourcery.com>
* quadmath-rounding-mode.h: New.
* printf/fpioconst.c: Update from GLIBC. Fix strtod rounding.
* printf/fpioconst.h: Ditto.
* printf/printf_fp.c (__quadmath_printf_fp): Update from GLIBC.
Make printf respect the rounding mode for decimal output.
* printf/printf_fphex.c (__quadmath_printf_fphex): Update from
GLIBC. Make printf respect the rounding mode for hex output.
* strtod/strtod_l.c: Update from GLIBC. Make strtod respect the
rounding mode. Fix strtod handling of underflow.
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
From-SVN: r193770
Diffstat (limited to 'libquadmath/printf/fpioconst.h')
-rw-r--r-- | libquadmath/printf/fpioconst.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libquadmath/printf/fpioconst.h b/libquadmath/printf/fpioconst.h index 4187555..7b7a40a 100644 --- a/libquadmath/printf/fpioconst.h +++ b/libquadmath/printf/fpioconst.h @@ -35,6 +35,14 @@ #define FLT128_MAX_10_EXP_LOG 12 /* = floor(log_2(FLT128_MAX_10_EXP)) */ +/* For strtoq, we need powers of 10 up to floor (log_2 (FLT128_MANT_DIG + - FLT128_MIN_EXP + 2)). */ +#if !defined __NO_LONG_DOUBLE_MATH && FLT128_MAX_EXP > 1024 +# define FPIOCONST_POW10_ARRAY_SIZE 15 +#else +# define FPIOCONST_POW10_ARRAY_SIZE 11 +#endif + /* The array with the number representation. */ #define __tens __quadmath_tens @@ -50,7 +58,7 @@ struct mp_power int m_expo; /* Exponent of the number 10^-(2^i-1). */ }; #define _fpioconst_pow10 __quadmath_fpioconst_pow10 -extern const struct mp_power _fpioconst_pow10[FLT128_MAX_10_EXP_LOG + 1] +extern const struct mp_power _fpioconst_pow10[FPIOCONST_POW10_ARRAY_SIZE] attribute_hidden; /* The constants in the array `_fpioconst_pow10' have an offset. */ |