summaryrefslogtreecommitdiffstats
path: root/generic/tclStrToD.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-25 20:32:26 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-25 20:32:26 (GMT)
commitefe1dce70b548e0af9d8a0e0e6cffbca6faa2cb5 (patch)
tree7f0acaa1096fe41786b2d878b1dd3eda76ad2e5b /generic/tclStrToD.c
parent25eedf811a9b5f1da159a902f286f481fe4ff8d2 (diff)
parent0c8bc1d8c271d764a054cda2cb12bce5e42761dc (diff)
downloadtcl-efe1dce70b548e0af9d8a0e0e6cffbca6faa2cb5.zip
tcl-efe1dce70b548e0af9d8a0e0e6cffbca6faa2cb5.tar.gz
tcl-efe1dce70b548e0af9d8a0e0e6cffbca6faa2cb5.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclStrToD.c')
-rw-r--r--generic/tclStrToD.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 478c16b..d542da0 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -145,7 +145,7 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
#define QUICK_MAX 14 /* floor((FP_PRECISION-1)*log(2)/log(10))-1 */
#define BLETCH 0x10 /* Highest power of two that is greater than
* DBL_MAX_10_EXP, divided by 16. */
-#define DIGIT_GROUP 8 /* floor(DIGIT_BIT*log(2)/log(10)) */
+#define DIGIT_GROUP 8 /* floor(MP_DIGIT_BIT*log(2)/log(10)) */
/*
* Union used to dismantle floating point numbers.
@@ -1485,9 +1485,9 @@ AccumulateDecimalDigit(
* More than single digit multiplication. Multiply by the appropriate
* small powers of 5, and then shift. Large strings of zeroes are
* eaten 256 at a time; this is less efficient than it could be, but
- * seems implausible. We presume that DIGIT_BIT is at least 27. The
+ * seems implausible. We presume that MP_DIGIT_BIT is at least 27. The
* first multiplication, by up to 10**7, is done with a one-DIGIT
- * multiply (this presumes that DIGIT_BIT >= 24).
+ * multiply (this presumes that MP_DIGIT_BIT >= 24).
*/
n = numZeros + 1;
@@ -3130,7 +3130,7 @@ StrictInt64Conversion(
*
* Test whether bankers' rounding should round a digit up. Assumption is
* made that the denominator of the fraction being tested is a power of
- * 2**DIGIT_BIT.
+ * 2**MP_DIGIT_BIT.
*
* Results:
* Returns 1 iff the fraction is more than 1/2, or if the fraction is
@@ -3142,7 +3142,7 @@ StrictInt64Conversion(
static inline int
ShouldBankerRoundUpPowD(
mp_int *b, /* Numerator of the fraction. */
- int sd, /* Denominator is 2**(sd*DIGIT_BIT). */
+ int sd, /* Denominator is 2**(sd*MP_DIGIT_BIT). */
int isodd) /* 1 if the digit is odd, 0 if even. */
{
int i;
@@ -3181,7 +3181,7 @@ static inline int
ShouldBankerRoundUpToNextPowD(
mp_int *b, /* Numerator of the fraction. */
mp_int *m, /* Numerator of the rounding tolerance. */
- int sd, /* Common denominator is 2**(sd*DIGIT_BIT). */
+ int sd, /* Common denominator is 2**(sd*MP_DIGIT_BIT). */
int isodd, /* 1 if the integer significand is odd. */
mp_int *temp) /* Work area for the calculation. */
{
@@ -3190,7 +3190,7 @@ ShouldBankerRoundUpToNextPowD(
/*
* Compare B and S-m - which is the same as comparing B+m and S - which we
* do by computing b+m and doing a bitwhack compare against
- * 2**(DIGIT_BIT*sd)
+ * 2**(MP_DIGIT_BIT*sd)
*/
mp_add(b, m, temp);
@@ -3218,7 +3218,7 @@ ShouldBankerRoundUpToNextPowD(
* Converts a double-precision number to the shortest string of digits
* that reconverts exactly to the given number, or to 'ilim' digits if
* that will yield a shorter result. The denominator in David Gay's
- * conversion algorithm is known to be a power of 2**DIGIT_BIT, and hence
+ * conversion algorithm is known to be a power of 2**MP_DIGIT_BIT, and hence
* the division in the main loop may be replaced by a digit shift and
* mask.
*
@@ -3298,7 +3298,7 @@ ShorteningBignumConversionPowD(
mp_init(&temp);
/*
- * Loop through the digits. Do division and mod by s == 2**(sd*DIGIT_BIT)
+ * Loop through the digits. Do division and mod by s == 2**(sd*MP_DIGIT_BIT)
* by mp_digit extraction.
*/
@@ -3410,7 +3410,7 @@ ShorteningBignumConversionPowD(
* Converts a double-precision number to a fixed-lengt string of 'ilim'
* digits (or 'ilim1' if log10(d) has been overestimated). The
* denominator in David Gay's conversion algorithm is known to be a power
- * of 2**DIGIT_BIT, and hence the division in the main loop may be
+ * of 2**MP_DIGIT_BIT, and hence the division in the main loop may be
* replaced by a digit shift and mask.
*
* Results:
@@ -3468,7 +3468,7 @@ StrictBignumConversionPowD(
}
/*
- * Loop through the digits. Do division and mod by s == 2**(sd*DIGIT_BIT)
+ * Loop through the digits. Do division and mod by s == 2**(sd*MP_DIGIT_BIT)
* by mp_digit extraction.
*/
@@ -4211,7 +4211,7 @@ TclDoubleDigits(
} else if (s5 == 0) {
/*
* The denominator is a power of 2, so we can replace division by
- * digit shifts. First we round up s2 to a multiple of DIGIT_BIT,
+ * digit shifts. First we round up s2 to a multiple of MP_DIGIT_BIT,
* and adjust m2 and b2 accordingly. Then we launch into a version
* of the comparison that's specialized for the 'power of mp_digit
* in the denominator' case.
@@ -4267,7 +4267,7 @@ TclDoubleDigits(
} else if (s5 == 0) {
/*
* The denominator is a power of 2, so we can replace division by
- * digit shifts. First we round up s2 to a multiple of DIGIT_BIT,
+ * digit shifts. First we round up s2 to a multiple of MP_DIGIT_BIT,
* and adjust m2 and b2 accordingly. Then we launch into a version
* of the comparison that's specialized for the 'power of mp_digit
* in the denominator' case.