summaryrefslogtreecommitdiffstats
path: root/generic/tclStrToD.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-05-14 19:13:01 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-05-14 19:13:01 (GMT)
commitde4f571baa7f9d53f48031e230c4d8f7c69cf1f5 (patch)
tree5a70c38238478aba4893b1207c3d5fe70bb83937 /generic/tclStrToD.c
parent9ca29b09ae01c2710010821b09fff5f613c7c26f (diff)
parent8094d33e4331c3f61d015b91018908fa6fb60b96 (diff)
downloadtcl-de4f571baa7f9d53f48031e230c4d8f7c69cf1f5.zip
tcl-de4f571baa7f9d53f48031e230c4d8f7c69cf1f5.tar.gz
tcl-de4f571baa7f9d53f48031e230c4d8f7c69cf1f5.tar.bz2
Merge 8.5
Diffstat (limited to 'generic/tclStrToD.c')
-rw-r--r--generic/tclStrToD.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 6257409..6e1b131 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -1855,15 +1855,15 @@ RefineApproximation(
*/
msb = binExponent + M2; /* 1008 */
- nDigits = msb / DIGIT_BIT + 1;
+ nDigits = msb / MP_DIGIT_BIT + 1;
mp_init_size(&twoMv, nDigits);
- i = (msb % DIGIT_BIT + 1);
+ i = (msb % MP_DIGIT_BIT + 1);
twoMv.used = nDigits;
significand *= SafeLdExp(1.0, i);
while (--nDigits >= 0) {
twoMv.dp[nDigits] = (mp_digit) significand;
significand -= (mp_digit) significand;
- significand = SafeLdExp(significand, DIGIT_BIT);
+ significand = SafeLdExp(significand, MP_DIGIT_BIT);
}
for (i = 0; i <= 8; ++i) {
if (M5 & (1 << i)) {
@@ -3162,7 +3162,7 @@ ShouldBankerRoundUpPowD(
int isodd) /* 1 if the digit is odd, 0 if even. */
{
int i;
- static const mp_digit topbit = ((mp_digit)1) << (DIGIT_BIT - 1);
+ static const mp_digit topbit = ((mp_digit)1) << (MP_DIGIT_BIT - 1);
if (b->used < sd || (b->dp[sd-1] & topbit) == 0) {
return 0;
@@ -4268,8 +4268,8 @@ TclDoubleDigits(
* in the denominator' case.
*/
- if (s2 % DIGIT_BIT != 0) {
- int delta = DIGIT_BIT - (s2 % DIGIT_BIT);
+ if (s2 % MP_DIGIT_BIT != 0) {
+ int delta = MP_DIGIT_BIT - (s2 % MP_DIGIT_BIT);
b2 += delta;
m2plus += delta;
@@ -4277,7 +4277,7 @@ TclDoubleDigits(
s2 += delta;
}
return ShorteningBignumConversionPowD(&d, convType, bw, b2, b5,
- m2plus, m2minus, m5, s2/DIGIT_BIT, k, len, ilim, ilim1,
+ m2plus, m2minus, m5, s2/MP_DIGIT_BIT, k, len, ilim, ilim1,
decpt, endPtr);
} else {
/*
@@ -4324,14 +4324,14 @@ TclDoubleDigits(
* in the denominator' case.
*/
- if (s2 % DIGIT_BIT != 0) {
- int delta = DIGIT_BIT - (s2 % DIGIT_BIT);
+ if (s2 % MP_DIGIT_BIT != 0) {
+ int delta = MP_DIGIT_BIT - (s2 % MP_DIGIT_BIT);
b2 += delta;
s2 += delta;
}
return StrictBignumConversionPowD(&d, convType, bw, b2, b5,
- s2/DIGIT_BIT, k, len, ilim, ilim1, decpt, endPtr);
+ s2/MP_DIGIT_BIT, k, len, ilim, ilim1, decpt, endPtr);
} else {
/*
* There are no helpful special cases, but at least we know in
@@ -4456,7 +4456,7 @@ TclInitDoubleConversion(void)
+ 0.5 * log(10.)) / log(10.));
minDigits = (int) floor((DBL_MIN_EXP - DBL_MANT_DIG)
* log((double) FLT_RADIX) / log(10.));
- log10_DIGIT_MAX = (int) floor(DIGIT_BIT * log(2.) / log(10.));
+ log10_DIGIT_MAX = (int) floor(MP_DIGIT_BIT * log(2.) / log(10.));
/*
* Nokia 770's software-emulated floating point is "middle endian": the
@@ -4660,7 +4660,7 @@ TclBignumToDouble(
r = 0.0;
for (i=b.used-1 ; i>=0 ; --i) {
- r = ldexp(r, DIGIT_BIT) + b.dp[i];
+ r = ldexp(r, MP_DIGIT_BIT) + b.dp[i];
}
mp_clear(&b);
@@ -4729,7 +4729,7 @@ TclCeil(
mp_add_d(&b, 1, &b);
}
for (i=b.used-1 ; i>=0 ; --i) {
- r = ldexp(r, DIGIT_BIT) + b.dp[i];
+ r = ldexp(r, MP_DIGIT_BIT) + b.dp[i];
}
r = ldexp(r, bits - mantBits);
}
@@ -4779,7 +4779,7 @@ TclFloor(
mp_copy(a, &b);
}
for (i=b.used-1 ; i>=0 ; --i) {
- r = ldexp(r, DIGIT_BIT) + b.dp[i];
+ r = ldexp(r, MP_DIGIT_BIT) + b.dp[i];
}
r = ldexp(r, bits - mantBits);
}
@@ -4841,7 +4841,7 @@ BignumToBiasedFrExp(
r = 0.0;
for (i=b.used-1; i>=0; --i) {
- r = ldexp(r, DIGIT_BIT) + b.dp[i];
+ r = ldexp(r, MP_DIGIT_BIT) + b.dp[i];
}
mp_clear(&b);