|
@@ -2579,7 +2579,7 @@ function checkRoundingDigits(d, i, rm, repeating) {
|
|
|
i %= LOG_BASE;
|
|
|
}
|
|
|
|
|
|
- // i is the index.vue (0 - 6) of the rounding digit.
|
|
|
+ // i is the index (0 - 6) of the rounding digit.
|
|
|
// E.g. if within the word 3487563 the first rounding digit is 5,
|
|
|
// then i = 4, k = 1000, rd = 3487563 % 1000 = 563
|
|
|
k = mathpow(10, LOG_BASE - i);
|
|
@@ -2962,11 +2962,11 @@ function finalise(x, sd, rm, isTruncated) {
|
|
|
|
|
|
// rd: the rounding digit, i.e. the digit after the digit that may be rounded up.
|
|
|
// w: the word of xd containing rd, a base 1e7 number.
|
|
|
- // xdi: the index.vue of w within xd.
|
|
|
+ // xdi: the index of w within xd.
|
|
|
// digits: the number of digits of w.
|
|
|
- // i: what would be the index.vue of rd within w if all the numbers were 7 digits long (i.e. if
|
|
|
+ // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if
|
|
|
// they had leading zeros)
|
|
|
- // j: if > 0, the actual index.vue of rd within w (if < 0, rd is a leading zero).
|
|
|
+ // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).
|
|
|
|
|
|
// Get the length of the first word of the digits array xd.
|
|
|
for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;
|
|
@@ -2978,7 +2978,7 @@ function finalise(x, sd, rm, isTruncated) {
|
|
|
j = sd;
|
|
|
w = xd[xdi = 0];
|
|
|
|
|
|
- // Get the rounding digit at index.vue j of w.
|
|
|
+ // Get the rounding digit at index j of w.
|
|
|
rd = w / mathpow(10, digits - j - 1) % 10 | 0;
|
|
|
} else {
|
|
|
xdi = Math.ceil((i + 1) / LOG_BASE);
|
|
@@ -3001,14 +3001,14 @@ function finalise(x, sd, rm, isTruncated) {
|
|
|
// Get the number of digits of w.
|
|
|
for (digits = 1; k >= 10; k /= 10) digits++;
|
|
|
|
|
|
- // Get the index.vue of rd within w.
|
|
|
+ // Get the index of rd within w.
|
|
|
i %= LOG_BASE;
|
|
|
|
|
|
- // Get the index.vue of rd within w, adjusted for leading zeros.
|
|
|
+ // Get the index of rd within w, adjusted for leading zeros.
|
|
|
// The number of leading zeros of w is given by LOG_BASE - digits.
|
|
|
j = i - LOG_BASE + digits;
|
|
|
|
|
|
- // Get the rounding digit at index.vue j of w.
|
|
|
+ // Get the rounding digit at index j of w.
|
|
|
rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;
|
|
|
}
|
|
|
}
|
|
@@ -3018,7 +3018,7 @@ function finalise(x, sd, rm, isTruncated) {
|
|
|
xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));
|
|
|
|
|
|
// The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right
|
|
|
- // of the digit at (left-to-right) index.vue j, e.g. if w is 908714 and j is 2, the expression
|
|
|
+ // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression
|
|
|
// will give 714.
|
|
|
|
|
|
roundUp = rm < 4 ?
|
|
@@ -3358,7 +3358,7 @@ function naturalExponential(x, sd) {
|
|
|
// If so, repeat the summation with a higher precision, otherwise
|
|
|
// e.g. with precision: 18, rounding: 1
|
|
|
// exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)
|
|
|
- // `wpr - guard` is the index.vue of first rounding digit.
|
|
|
+ // `wpr - guard` is the index of first rounding digit.
|
|
|
if (sd == null) {
|
|
|
|
|
|
if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
|
|
@@ -3488,7 +3488,7 @@ function naturalLogarithm(y, sd) {
|
|
|
// If so, restart the summation with a higher precision, otherwise
|
|
|
// e.g. with precision: 12, rounding: 1
|
|
|
// ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.
|
|
|
- // `wpr - guard` is the index.vue of first rounding digit.
|
|
|
+ // `wpr - guard` is the index of first rounding digit.
|
|
|
if (sd == null) {
|
|
|
if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
|
|
|
Ctor.precision = wpr += guard;
|