diff options
Diffstat (limited to 'generic/tclStrToD.c')
-rwxr-xr-x | generic/tclStrToD.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 9577798..b9b9950 100755 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStrToD.c,v 1.41 2010/03/05 14:34:04 dkf Exp $ + * RCS: @(#) $Id: tclStrToD.c,v 1.42 2010/04/02 19:23:58 kennykb Exp $ * *---------------------------------------------------------------------- */ @@ -110,7 +110,6 @@ static int log2FLT_RADIX; /* Logarithm of the floating point radix. */ static int mantBits; /* Number of bits in a double's significand */ static mp_int pow5[9]; /* Table of powers of 5**(2**n), up to * 5**256 */ -static double tiny; /* The smallest representable double */ static int maxDigits; /* The maximum number of digits to the left of * the decimal point of a double. */ static int minDigits; /* The maximum number of digits to the right @@ -1490,8 +1489,8 @@ MakeHighPrecisionDouble( goto returnValue; } retval = SafeLdExp(retval, machexp); - if (retval < tiny) { - retval = tiny; + if (retval <= 0.0) { + retval = SafeLdExp(1.0, DBL_MIN_EXP * log2FLT_RADIX - mantBits); } /* @@ -2245,7 +2244,6 @@ TclInitDoubleConversion(void) * the significand of a double. */ - tiny = SafeLdExp(1.0, DBL_MIN_EXP * log2FLT_RADIX - mantBits); maxDigits = (int) ((DBL_MAX_EXP * log((double) FLT_RADIX) + 0.5 * log(10.)) / log(10.)); minDigits = (int) floor((DBL_MIN_EXP - DBL_MANT_DIG) |