diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-05-14 18:42:59 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-05-14 18:42:59 (GMT) |
commit | 8094d33e4331c3f61d015b91018908fa6fb60b96 (patch) | |
tree | b5d2417771b80a199ad0cd55f85480951fa55404 /generic/tclStrToD.c | |
parent | 95d2a7f7c08f468c9d9dbfed451dd3bad2a37129 (diff) | |
download | tcl-8094d33e4331c3f61d015b91018908fa6fb60b96.zip tcl-8094d33e4331c3f61d015b91018908fa6fb60b96.tar.gz tcl-8094d33e4331c3f61d015b91018908fa6fb60b96.tar.bz2 |
DIGIT_BIT -> MP_DIGIT_BIT, since DIGIT_BIT is deprecated in future libtommath versions. So, better stop using it at all.
Also add some other defines/typdefs for future libtommath compatibility.
Diffstat (limited to 'generic/tclStrToD.c')
-rw-r--r-- | generic/tclStrToD.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index b89ce45..3ed4349 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -1833,15 +1833,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)) { @@ -3117,7 +3117,7 @@ ShouldBankerRoundUpPowD(mp_int* b, /* 1 if the digit is odd, 0 if even */ { int i; - static const mp_digit topbit = (1<<(DIGIT_BIT-1)); + static const mp_digit topbit = (1<<(MP_DIGIT_BIT-1)); if (b->used < sd || (b->dp[sd-1] & topbit) == 0) { return 0; } @@ -4238,8 +4238,8 @@ TclDoubleDigits(double dv, /* Number to convert */ * into a version of the comparison that's specialized for * the 'power of mp_digit 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; m2minus += delta; @@ -4247,7 +4247,7 @@ TclDoubleDigits(double dv, /* Number to convert */ } return ShorteningBignumConversionPowD(&d, convType, bw, b2, b5, m2plus, m2minus, m5, - s2/DIGIT_BIT, k, len, + s2/MP_DIGIT_BIT, k, len, ilim, ilim1, decpt, endPtr); } else { @@ -4298,13 +4298,13 @@ TclDoubleDigits(double dv, /* Number to convert */ * into a version of the comparison that's specialized for * the 'power of mp_digit 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, + s2/MP_DIGIT_BIT, k, len, ilim, ilim1, decpt, endPtr); } else { /* @@ -4433,7 +4433,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 @@ -4634,7 +4634,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); @@ -4703,7 +4703,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); } @@ -4753,7 +4753,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); } @@ -4815,7 +4815,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); |