summaryrefslogtreecommitdiffstats
path: root/contrib/gdtoa/gdtoaimp.h
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2008-09-03 07:23:57 +0000
committerdas <das@FreeBSD.org>2008-09-03 07:23:57 +0000
commit2732388653bc1d73e3e22df8de7d745845b3f37f (patch)
treeaa29ae5df5dd7a529e8fb86a22f1dd405bf30837 /contrib/gdtoa/gdtoaimp.h
parent88c5e9e192dc799e18634d995e809f49fcd1e4eb (diff)
downloadFreeBSD-src-2732388653bc1d73e3e22df8de7d745845b3f37f.zip
FreeBSD-src-2732388653bc1d73e3e22df8de7d745845b3f37f.tar.gz
Merge gdtoa 20080831. This fixes several bugs, including an infinite
loop pointed out by cognet@ that occurs when calling strtod() with a string representing a number between DBL_MAX and 2*DBL_MAX, when the rounding mode is anything other than the default.
Diffstat (limited to 'contrib/gdtoa/gdtoaimp.h')
-rw-r--r--contrib/gdtoa/gdtoaimp.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/contrib/gdtoa/gdtoaimp.h b/contrib/gdtoa/gdtoaimp.h
index 0790b5e..916e156 100644
--- a/contrib/gdtoa/gdtoaimp.h
+++ b/contrib/gdtoa/gdtoaimp.h
@@ -132,13 +132,16 @@ THIS SOFTWARE.
* Infinity and NaN (case insensitively).
* When INFNAN_CHECK is #defined and No_Hex_NaN is not #defined,
* strtodg also accepts (case insensitively) strings of the form
- * NaN(x), where x is a string of hexadecimal digits and spaces;
- * if there is only one string of hexadecimal digits, it is taken
- * for the fraction bits of the resulting NaN; if there are two or
- * more strings of hexadecimal digits, each string is assigned
- * to the next available sequence of 32-bit words of fractions
- * bits (starting with the most significant), right-aligned in
- * each sequence.
+ * NaN(x), where x is a string of hexadecimal digits (optionally
+ * preceded by 0x or 0X) and spaces; if there is only one string
+ * of hexadecimal digits, it is taken for the fraction bits of the
+ * resulting NaN; if there are two or more strings of hexadecimal
+ * digits, each string is assigned to the next available sequence
+ * of 32-bit words of fractions bits (starting with the most
+ * significant), right-aligned in each sequence.
+ * Unless GDTOA_NON_PEDANTIC_NANCHECK is #defined, input "NaN(...)"
+ * is consumed even when ... has the wrong form (in which case the
+ * "(...)" is consumed but ignored).
* #define MULTIPLE_THREADS if the system offers preemptively scheduled
* multiple threads. In this case, you must provide (or suitably
* #define) two locks, acquired by ACQUIRE_DTOA_LOCK(n) and freed
@@ -150,7 +153,7 @@ THIS SOFTWARE.
* dtoa. You may do so whether or not MULTIPLE_THREADS is #defined.
* #define IMPRECISE_INEXACT if you do not care about the setting of
* the STRTOG_Inexact bits in the special case of doing IEEE double
- * precision conversions (which could also be done by the strtog in
+ * precision conversions (which could also be done by the strtod in
* dtoa.c).
* #define NO_HEX_FP to disable recognition of C9x's hexadecimal
* floating-point constants.
@@ -204,6 +207,7 @@ extern Char *MALLOC ANSI((size_t));
#define INFNAN_CHECK
#define USE_LOCALE
#define Honor_FLT_ROUNDS
+#define Trust_FLT_ROUNDS
#undef IEEE_Arith
#undef Avoid_Underflow
@@ -597,7 +601,7 @@ extern void memcpy_D2A ANSI((void*, const void*, size_t));
extern int cmp ANSI((Bigint*, Bigint*));
extern void copybits ANSI((ULong*, int, Bigint*));
extern Bigint *d2b ANSI((double, int*, int*));
- extern int decrement ANSI((Bigint*));
+ extern void decrement ANSI((Bigint*));
extern Bigint *diff ANSI((Bigint*, Bigint*));
extern char *dtoa ANSI((double d, int mode, int ndigits,
int *decpt, int *sign, char **rve));
OpenPOWER on IntegriCloud