diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ftoastr.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/ftoastr.h b/lib/ftoastr.h index 6236292d9d9..26cad7369ce 100644 --- a/lib/ftoastr.h +++ b/lib/ftoastr.h | |||
| @@ -72,12 +72,13 @@ enum | |||
| 72 | 72 | ||
| 73 | /* _GL_FLT_PREC_BOUND is an upper bound on the precision needed to | 73 | /* _GL_FLT_PREC_BOUND is an upper bound on the precision needed to |
| 74 | represent a float value without losing information. Likewise for | 74 | represent a float value without losing information. Likewise for |
| 75 | _GL_DBL_PREC_BOUND and double, and _GL_LDBL_PREC_BOUND and long double. */ | 75 | _GL_DBL_PREC_BOUND and double, and _GL_LDBL_PREC_BOUND and long double. |
| 76 | These are macros, not enums, to work around a bug in IBM xlc 12.1. */ | ||
| 76 | 77 | ||
| 77 | #if FLT_RADIX == 10 /* decimal floating point */ | 78 | #if FLT_RADIX == 10 /* decimal floating point */ |
| 78 | enum { _GL_FLT_PREC_BOUND = FLT_MANT_DIG }; | 79 | # define _GL_FLT_PREC_BOUND FLT_MANT_DIG |
| 79 | enum { _GL_DBL_PREC_BOUND = DBL_MANT_DIG }; | 80 | # define _GL_DBL_PREC_BOUND DBL_MANT_DIG |
| 80 | enum { _GL_LDBL_PREC_BOUND = LDBL_MANT_DIG }; | 81 | # define _GL_LDBL_PREC_BOUND LDBL_MANT_DIG |
| 81 | #else | 82 | #else |
| 82 | 83 | ||
| 83 | /* An upper bound on the number of bits needed to represent a single | 84 | /* An upper bound on the number of bits needed to represent a single |
| @@ -95,13 +96,13 @@ enum | |||
| 95 | DIG digits. For why the "+ 1" is needed, see "Binary to Decimal | 96 | DIG digits. For why the "+ 1" is needed, see "Binary to Decimal |
| 96 | Conversion" in David Goldberg's paper "What Every Computer | 97 | Conversion" in David Goldberg's paper "What Every Computer |
| 97 | Scientist Should Know About Floating-Point Arithmetic" | 98 | Scientist Should Know About Floating-Point Arithmetic" |
| 98 | <http://docs.sun.com/source/806-3568/ncg_goldberg.html>. */ | 99 | <http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html>. */ |
| 99 | # define _GL_FLOAT_PREC_BOUND(dig) \ | 100 | # define _GL_FLOAT_PREC_BOUND(dig) \ |
| 100 | (INT_BITS_STRLEN_BOUND ((dig) * _GL_FLOAT_DIG_BITS_BOUND) + 1) | 101 | (INT_BITS_STRLEN_BOUND ((dig) * _GL_FLOAT_DIG_BITS_BOUND) + 1) |
| 101 | 102 | ||
| 102 | enum { _GL_FLT_PREC_BOUND = _GL_FLOAT_PREC_BOUND ( FLT_MANT_DIG) }; | 103 | # define _GL_FLT_PREC_BOUND _GL_FLOAT_PREC_BOUND ( FLT_MANT_DIG) |
| 103 | enum { _GL_DBL_PREC_BOUND = _GL_FLOAT_PREC_BOUND ( DBL_MANT_DIG) }; | 104 | # define _GL_DBL_PREC_BOUND _GL_FLOAT_PREC_BOUND ( DBL_MANT_DIG) |
| 104 | enum { _GL_LDBL_PREC_BOUND = _GL_FLOAT_PREC_BOUND (LDBL_MANT_DIG) }; | 105 | # define _GL_LDBL_PREC_BOUND _GL_FLOAT_PREC_BOUND (LDBL_MANT_DIG) |
| 105 | #endif | 106 | #endif |
| 106 | 107 | ||
| 107 | 108 | ||