summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2010-04-02 19:23:57 (GMT)
committerKevin B Kenny <kennykb@acm.org>2010-04-02 19:23:57 (GMT)
commiteea8077922683bcbf1bfa11eaf8f26e5c95c0b49 (patch)
treed117c715d2206511cee2126b222718a7fd116fa6 /generic
parentacc46294253a87374633bdf1c1945bfaf95b2edb (diff)
downloadtcl-eea8077922683bcbf1bfa11eaf8f26e5c95c0b49.zip
tcl-eea8077922683bcbf1bfa11eaf8f26e5c95c0b49.tar.gz
tcl-eea8077922683bcbf1bfa11eaf8f26e5c95c0b49.tar.bz2
* generic/tclStrToD.c: [Bug 2952904]: Defer creation of the smallest
floating point number until it is actually used. (This change avoids a bogus syslog message regarding a 'floating point software assist fault' on SGI systems.)
Diffstat (limited to 'generic')
-rwxr-xr-xgeneric/tclStrToD.c8
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)