@phensley/decimal
Advanced tools
Comparing version 0.7.3 to 0.7.4
@@ -590,2 +590,3 @@ "use strict"; | ||
if (mode === void 0) { mode = 'half-even'; } | ||
var _a, _b, _c; | ||
if (shift <= 0 || this.sign === 0) { | ||
@@ -598,3 +599,3 @@ return; | ||
var div = new math_1.DivMod(); | ||
var _a = div.word(shift, 7 /* RDIGITS */), q = _a[0], r = _a[1]; | ||
var _d = div.word(shift, 7 /* RDIGITS */), q = _d[0], r = _d[1]; | ||
var i = 0, j = 0; | ||
@@ -604,3 +605,3 @@ var rnd = 0, rest = 0; | ||
if (q > 0) { | ||
_b = div.pow10(data[q - 1], 7 /* RDIGITS */ - 1), rnd = _b[0], rest = _b[1]; | ||
_a = div.pow10(data[q - 1], 7 /* RDIGITS */ - 1), rnd = _a[0], rest = _a[1]; | ||
if (rest === 0) { | ||
@@ -622,4 +623,4 @@ rest = operations_1.allzero(data, q - 1) === 0 ? 1 : 0; | ||
var ph = types_1.POWERS10[7 /* RDIGITS */ - r]; | ||
_c = div.pow10(data[q], r), hiprev = _c[0], rest = _c[1]; | ||
_d = div.pow10(rest, r - 1), rnd = _d[0], rest = _d[1]; | ||
_b = div.pow10(data[q], r), hiprev = _b[0], rest = _b[1]; | ||
_c = div.pow10(rest, r - 1), rnd = _c[0], rest = _c[1]; | ||
if (rest === 0 && q > 0) { | ||
@@ -641,3 +642,2 @@ rest = operations_1.allzero(data, q) === 0 ? 1 : 0; | ||
w.trim(); | ||
var _b, _c, _d; | ||
}; | ||
@@ -752,2 +752,3 @@ Decimal.prototype._setScale = function (scale, roundingMode) { | ||
Decimal.prototype.addsub = function (u, v, vsign) { | ||
var _a, _b, _c; | ||
var zero = u.sign === 0; | ||
@@ -794,3 +795,2 @@ if (zero || v.sign === 0) { | ||
return w.trim(); | ||
var _a, _b, _c; | ||
}; | ||
@@ -797,0 +797,0 @@ /** |
@@ -22,3 +22,3 @@ export interface Part { | ||
render(): Part[]; | ||
private current(); | ||
private current; | ||
} |
@@ -7,6 +7,7 @@ "use strict"; | ||
exports.compare = function (a, b, shift) { | ||
var _a, _b; | ||
var div = new math_1.DivMod(); | ||
var n = a.length; | ||
var m = b.length; | ||
var _a = div.word(shift, 7 /* RDIGITS */), q = _a[0], r = _a[1]; | ||
var _c = div.word(shift, 7 /* RDIGITS */), q = _c[0], r = _c[1]; | ||
if (r === 0) { | ||
@@ -28,3 +29,3 @@ while (--m >= 0) { | ||
--n; | ||
_b = div.pow10(b[m--], 7 /* RDIGITS */ - r), hi = _b[0], loprev = _b[1]; | ||
_a = div.pow10(b[m--], 7 /* RDIGITS */ - r), hi = _a[0], loprev = _a[1]; | ||
if (hi !== 0) { | ||
@@ -39,3 +40,3 @@ c = cmp(a[n], hi); | ||
for (; m >= 0; m--, n--) { | ||
_c = div.pow10(b[m], 7 /* RDIGITS */ - r), hi = _c[0], lo = _c[1]; | ||
_b = div.pow10(b[m], 7 /* RDIGITS */ - r), hi = _b[0], lo = _b[1]; | ||
x = ph * loprev + hi; | ||
@@ -55,3 +56,2 @@ c = cmp(a[n], x); | ||
return Number(!exports.allzero(a, q)); | ||
var _b, _c; | ||
}; | ||
@@ -58,0 +58,0 @@ exports.allzero = function (data, len) { |
@@ -21,3 +21,3 @@ import { Decimal, DecimalArg } from './decimal'; | ||
toString(): string; | ||
private _parse(raw); | ||
private _parse; | ||
} |
@@ -23,3 +23,3 @@ export declare type RoundingModeType = 'up' | 'down' | 'ceiling' | 'floor' | 'half-up' | 'half-down' | 'half-even' | '05up' | 'truncate'; | ||
P7 = 10000000, | ||
P8 = 100000000, | ||
P8 = 100000000 | ||
} | ||
@@ -31,3 +31,3 @@ export declare const POWERS10: Constants[]; | ||
FRACTION = 2, | ||
EXPONENT = 3, | ||
EXPONENT = 3 | ||
} | ||
@@ -37,3 +37,3 @@ export declare const enum ParseFlags { | ||
POINT = 2, | ||
EXP = 4, | ||
EXP = 4 | ||
} | ||
@@ -55,3 +55,3 @@ export declare const enum Chars { | ||
ELOWER = 69, | ||
EUPPER = 101, | ||
EUPPER = 101 | ||
} |
{ | ||
"name": "@phensley/decimal", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "Arbitrary precision decimal math", | ||
@@ -39,3 +39,3 @@ "main": "lib/index.js", | ||
"tslint-no-circular-imports": "^0.2.1", | ||
"typescript": "~2.8.3" | ||
"typescript": "3.x" | ||
}, | ||
@@ -42,0 +42,0 @@ "jest": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106953