summaryrefslogtreecommitdiffstats
path: root/generic/tclStrToD.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-25 16:09:50 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-10-25 16:09:50 (GMT)
commitd31b63df9cce749a88f06ee81883cbe92be28c77 (patch)
treed08d4b7774ceb2458be910ee607fd254537da5d5 /generic/tclStrToD.c
parent94ef14f2fe7454b1f9483b2718ae78c3f578959b (diff)
downloadtcl-d31b63df9cce749a88f06ee81883cbe92be28c77.zip
tcl-d31b63df9cce749a88f06ee81883cbe92be28c77.tar.gz
tcl-d31b63df9cce749a88f06ee81883cbe92be28c77.tar.bz2
Put #define's in alphabetical order.
Use MP_DIGIT_BIT in stead of (deprecated) DIGIT_BIT everywhere. (just code cleanup, nothing funcional)
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 94e7600..9eeb89d 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -152,7 +152,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.
@@ -1491,9 +1491,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;
@@ -3146,7 +3146,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
@@ -3158,7 +3158,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;
@@ -3197,7 +3197,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 convType, /* Conversion type: STEELE defeats
* round-to-even (not sure why one wants to do
* this; I copied it from Gay). FIXME */
@@ -3209,7 +3209,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);
@@ -3241,7 +3241,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.
*
@@ -3323,7 +3323,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.
*/
@@ -3435,7 +3435,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:
@@ -3496,7 +3496,7 @@ StrictBignumConversionPowD(
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.
*/
@@ -4262,7 +4262,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.
@@ -4318,7 +4318,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.