@eternl/big 0.10.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # @eternl/big
2
+
3
+ Private `big.js`-compatible package for arbitrary-precision decimal arithmetic, implemented as a
4
+ single-file TypeScript runtime in `src/index.ts` with workspace-local bigint-aware typings.
5
+
6
+ ## Installation
7
+
8
+ ```sh
9
+ npm install @eternl/big
10
+ ```
11
+
12
+ This package is published as a restricted scoped package and is intended for internal Eternl modules.
13
+
14
+ ## Usage
15
+
16
+ ```ts
17
+ import Big from '@eternl/big'
18
+
19
+ const amount = new Big('9007199254740993')
20
+ const sum = amount.plus(7n)
21
+
22
+ sum.toString()
23
+ ```
24
+
25
+ ## Source Attribution
26
+
27
+ This package is a behavior-preserving TypeScript port of [`big.js`](https://github.com/MikeMcl/big.js)
28
+ (version `7.0.1`) and adapts TypeScript typings to support `bigint` as input.
29
+
30
+ ## Third-Party License
31
+
32
+ The vendored upstream license is documented in
33
+ [`THIRD_PARTY_NOTICES.md`](./THIRD_PARTY_NOTICES.md).
@@ -0,0 +1,37 @@
1
+ # Third-Party Notices
2
+
3
+ ## big.js
4
+
5
+ - Source: https://github.com/MikeMcl/big.js
6
+ - Vendored from: `tmp/big.js`
7
+ - Upstream version: `7.0.1`
8
+ - Upstream license file: `tmp/big.js/LICENCE.md`
9
+ - Included files: `src/index.ts` (ported and typed upstream runtime)
10
+
11
+ ### MIT License (big.js)
12
+
13
+ The MIT License (MIT)
14
+ =====================
15
+
16
+ Copyright (c) 2025 Michael Mclaughlin
17
+
18
+ Permission is hereby granted, free of charge, to any person
19
+ obtaining a copy of this software and associated documentation
20
+ files (the "Software"), to deal in the Software without
21
+ restriction, including without limitation the rights to use,
22
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
23
+ copies of the Software, and to permit persons to whom the
24
+ Software is furnished to do so, subject to the following
25
+ conditions:
26
+
27
+ The above copyright notice and this permission notice shall be
28
+ included in all copies or substantial portions of the Software.
29
+
30
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
32
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
34
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
35
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
36
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
37
+ OTHER DEALINGS IN THE SOFTWARE.
package/dist/index.cjs ADDED
@@ -0,0 +1,431 @@
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+
3
+ //#region src/index.ts
4
+ /************************************** EDITABLE DEFAULTS *****************************************/
5
+ var DP = 20, RM = 1, MAX_DP = 1e6, MAX_POWER = 1e6, NE = -7, PE = 21, STRICT = false, NAME = "[big.js] ", INVALID = NAME + "Invalid ", INVALID_DP = INVALID + "decimal places", INVALID_RM = INVALID + "rounding mode", DIV_BY_ZERO = NAME + "Division by zero", P = {}, UNDEFINED = void 0, NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
6
+ function _Big_() {
7
+ function Big(n) {
8
+ const Ctor = Big;
9
+ const x = this;
10
+ if (!(x instanceof Ctor)) return n === UNDEFINED && arguments.length === 0 ? _Big_() : new Ctor(n);
11
+ const instance = x;
12
+ if (n instanceof Ctor) {
13
+ instance.s = n.s;
14
+ instance.e = n.e;
15
+ instance.c = n.c.slice();
16
+ } else {
17
+ let value = n;
18
+ if (typeof value !== "string") {
19
+ if (Ctor.strict === true && typeof value !== "bigint") throw TypeError(INVALID + "value");
20
+ value = value === 0 && 1 / value < 0 ? "-0" : String(value);
21
+ }
22
+ parse(instance, value);
23
+ }
24
+ instance.constructor = Ctor;
25
+ }
26
+ const Ctor = Big;
27
+ Ctor.prototype = P;
28
+ Ctor.DP = DP;
29
+ Ctor.RM = RM;
30
+ Ctor.NE = NE;
31
+ Ctor.PE = PE;
32
+ Ctor.strict = STRICT;
33
+ Ctor.roundDown = 0;
34
+ Ctor.roundHalfUp = 1;
35
+ Ctor.roundHalfEven = 2;
36
+ Ctor.roundUp = 3;
37
+ return Ctor;
38
+ }
39
+ function negateSign(s) {
40
+ return s === 1 ? -1 : 1;
41
+ }
42
+ function parse(x, n) {
43
+ var e, i, nl;
44
+ if (!NUMERIC.test(n)) throw Error(INVALID + "number");
45
+ x.s = n.charAt(0) == "-" ? (n = n.slice(1), -1) : 1;
46
+ if ((e = n.indexOf(".")) > -1) n = n.replace(".", "");
47
+ if ((i = n.search(/e/i)) > 0) {
48
+ if (e < 0) e = i;
49
+ e += +n.slice(i + 1);
50
+ n = n.substring(0, i);
51
+ } else if (e < 0) e = n.length;
52
+ nl = n.length;
53
+ for (i = 0; i < nl && n.charAt(i) == "0";) ++i;
54
+ if (i == nl) x.c = [x.e = 0];
55
+ else {
56
+ for (; nl > 0 && n.charAt(--nl) == "0";);
57
+ x.e = e - i - 1;
58
+ x.c = [];
59
+ for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);
60
+ }
61
+ return x;
62
+ }
63
+ function round(x, sd, rm, more) {
64
+ var xc = x.c;
65
+ var d0 = xc[0] ?? 0;
66
+ if (rm === UNDEFINED) rm = x.constructor.RM;
67
+ if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) throw Error(INVALID_RM);
68
+ if (sd < 1) {
69
+ more = rm === 3 && (more || !!xc[0]) || sd === 0 && (rm === 1 && d0 >= 5 || rm === 2 && (d0 > 5 || d0 === 5 && (more || xc[1] !== UNDEFINED)));
70
+ xc.length = 1;
71
+ if (more) {
72
+ x.e = x.e - sd + 1;
73
+ xc[0] = 1;
74
+ } else xc[0] = x.e = 0;
75
+ } else if (sd < xc.length) {
76
+ d0 = xc[sd] ?? 0;
77
+ more = rm === 1 && d0 >= 5 || rm === 2 && (d0 > 5 || d0 === 5 && (more || xc[sd + 1] !== UNDEFINED || ((xc[sd - 1] ?? 0) & 1) === 1)) || rm === 3 && (more || !!xc[0]);
78
+ xc.length = sd;
79
+ if (more) for (; ++xc[--sd] > 9;) {
80
+ xc[sd] = 0;
81
+ if (sd === 0) {
82
+ ++x.e;
83
+ xc.unshift(1);
84
+ break;
85
+ }
86
+ }
87
+ for (sd = xc.length; !xc[--sd];) xc.pop();
88
+ }
89
+ return x;
90
+ }
91
+ function stringify(x, doExponential, isNonzero) {
92
+ var e = x.e, s = x.c.join(""), n = s.length;
93
+ if (doExponential) s = s.charAt(0) + (n > 1 ? "." + s.slice(1) : "") + (e < 0 ? "e" : "e+") + e;
94
+ else if (e < 0) {
95
+ for (; ++e;) s = "0" + s;
96
+ s = "0." + s;
97
+ } else if (e > 0) {
98
+ if (++e > n) for (e -= n; e--;) s += "0";
99
+ else if (e < n) s = s.slice(0, e) + "." + s.slice(e);
100
+ } else if (n > 1) s = s.charAt(0) + "." + s.slice(1);
101
+ return x.s < 0 && isNonzero ? "-" + s : s;
102
+ }
103
+ P.abs = function() {
104
+ var x = new this.constructor(this);
105
+ x.s = 1;
106
+ return x;
107
+ };
108
+ P.cmp = function(y) {
109
+ var i, j, isneg, x = this, xc = x.c, yBig = new x.constructor(y), yc = yBig.c, xs = x.s, ys = yBig.s, k = x.e, l = yBig.e;
110
+ if (!xc[0] || !yc[0]) return !xc[0] ? !yc[0] ? 0 : negateSign(ys) : xs;
111
+ if (xs != ys) return xs;
112
+ isneg = xs < 0;
113
+ if (k != l) return (k > l ? 1 : 0) ^ (isneg ? 1 : 0) ? 1 : -1;
114
+ j = (k = xc.length) < (l = yc.length) ? k : l;
115
+ for (i = -1; ++i < j;) if (xc[i] != yc[i]) return (xc[i] > yc[i] ? 1 : 0) ^ (isneg ? 1 : 0) ? 1 : -1;
116
+ return k == l ? 0 : (k > l ? 1 : 0) ^ (isneg ? 1 : 0) ? 1 : -1;
117
+ };
118
+ P.div = function(y) {
119
+ var x = this, Big = x.constructor, a = x.c, yBig = new Big(y), b = yBig.c, sign = x.s == yBig.s ? 1 : -1, dp = Big.DP;
120
+ if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP);
121
+ if (!b[0]) throw Error(DIV_BY_ZERO);
122
+ if (!a[0]) {
123
+ yBig.s = sign;
124
+ yBig.c = [yBig.e = 0];
125
+ return yBig;
126
+ }
127
+ var bl, bt, n, cmp, ri, bz = b.slice(), ai = bl = b.length, al = a.length, r = a.slice(0, bl), rl = r.length, q = yBig, qc = q.c = [], qi = 0, p = dp + (q.e = x.e - yBig.e) + 1, k = p < 0 ? 0 : p;
128
+ q.s = sign;
129
+ bz.unshift(0);
130
+ for (; rl++ < bl;) r.push(0);
131
+ do {
132
+ for (n = 0; n < 10; n++) {
133
+ if (bl != (rl = r.length)) cmp = bl > rl ? 1 : -1;
134
+ else for (ri = -1, cmp = 0; ++ri < bl;) if (b[ri] != r[ri]) {
135
+ cmp = b[ri] > r[ri] ? 1 : -1;
136
+ break;
137
+ }
138
+ if (cmp < 0) {
139
+ for (bt = rl == bl ? b : bz; rl;) {
140
+ if (r[--rl] < bt[rl]) {
141
+ ri = rl;
142
+ for (; ri && !r[--ri];) r[ri] = 9;
143
+ --r[ri];
144
+ r[rl] = (r[rl] ?? 0) + 10;
145
+ }
146
+ r[rl] = (r[rl] ?? 0) - bt[rl];
147
+ }
148
+ for (; !r[0];) r.shift();
149
+ } else break;
150
+ }
151
+ qc[qi++] = cmp ? n : ++n;
152
+ if (r[0] && cmp) r[rl] = a[ai] || 0;
153
+ else r = [a[ai]];
154
+ } while ((ai++ < al || r[0] !== UNDEFINED) && k--);
155
+ if (!qc[0] && qi != 1) {
156
+ qc.shift();
157
+ q.e--;
158
+ p--;
159
+ }
160
+ if (qi > p) round(q, p, Big.RM, r[0] !== UNDEFINED);
161
+ return q;
162
+ };
163
+ P.eq = function(y) {
164
+ return this.cmp(y) === 0;
165
+ };
166
+ P.gt = function(y) {
167
+ return this.cmp(y) > 0;
168
+ };
169
+ P.gte = function(y) {
170
+ return this.cmp(y) > -1;
171
+ };
172
+ P.lt = function(y) {
173
+ return this.cmp(y) < 0;
174
+ };
175
+ P.lte = function(y) {
176
+ return this.cmp(y) < 1;
177
+ };
178
+ P.minus = P.sub = function(y) {
179
+ var i, j, t, xlty, x = this, Big = x.constructor, yBig = new Big(y), a = x.s, b = yBig.s;
180
+ if (a != b) {
181
+ yBig.s = negateSign(b);
182
+ return x.plus(yBig);
183
+ }
184
+ var xc = x.c.slice(), xe = x.e, yc = yBig.c, ye = yBig.e, aDiff = xe - ye;
185
+ if (!xc[0] || !yc[0]) {
186
+ if (yc[0]) yBig.s = negateSign(b);
187
+ else if (xc[0]) yBig = new Big(x);
188
+ else yBig.s = 1;
189
+ return yBig;
190
+ }
191
+ if (aDiff) {
192
+ if (xlty = aDiff < 0) {
193
+ aDiff = -aDiff;
194
+ t = xc;
195
+ } else {
196
+ ye = xe;
197
+ t = yc;
198
+ }
199
+ t.reverse();
200
+ for (j = aDiff; j--;) t.push(0);
201
+ t.reverse();
202
+ } else {
203
+ j = ((xlty = xc.length < yc.length) ? xc : yc).length;
204
+ for (i = 0; i < j; i++) if (xc[i] != yc[i]) {
205
+ xlty = xc[i] < yc[i];
206
+ break;
207
+ }
208
+ }
209
+ if (xlty) {
210
+ t = xc;
211
+ xc = yc;
212
+ yc = t;
213
+ yBig.s = negateSign(yBig.s);
214
+ }
215
+ if ((j = yc.length - (i = xc.length)) > 0) for (; j--;) xc[i++] = 0;
216
+ for (j = i; j > aDiff;) {
217
+ if (xc[--j] < (yc[j] ?? 0)) {
218
+ for (i = j; i && !xc[--i];) xc[i] = 9;
219
+ --xc[i];
220
+ xc[j] = (xc[j] ?? 0) + 10;
221
+ }
222
+ xc[j] = (xc[j] ?? 0) - (yc[j] ?? 0);
223
+ }
224
+ for (j = xc.length; xc[--j] === 0;) xc.pop();
225
+ for (; xc[0] === 0;) {
226
+ xc.shift();
227
+ --ye;
228
+ }
229
+ if (!xc[0]) {
230
+ yBig.s = 1;
231
+ xc = [ye = 0];
232
+ }
233
+ yBig.c = xc;
234
+ yBig.e = ye;
235
+ return yBig;
236
+ };
237
+ P.mod = function(y) {
238
+ var ygtx, x = this, Big = x.constructor, yBig = new Big(y), xSign = x.s, ySign = yBig.s, dp, rm;
239
+ if (!yBig.c[0]) throw Error(DIV_BY_ZERO);
240
+ x.s = yBig.s = 1;
241
+ ygtx = yBig.cmp(x) == 1;
242
+ x.s = xSign;
243
+ yBig.s = ySign;
244
+ if (ygtx) return new Big(x);
245
+ dp = Big.DP;
246
+ rm = Big.RM;
247
+ Big.DP = 0;
248
+ Big.RM = 0;
249
+ x = x.div(yBig);
250
+ Big.DP = dp;
251
+ Big.RM = rm;
252
+ return this.minus(x.times(yBig));
253
+ };
254
+ P.neg = function() {
255
+ var x = new this.constructor(this);
256
+ x.s = negateSign(x.s);
257
+ return x;
258
+ };
259
+ P.plus = P.add = function(y) {
260
+ var e, k, t, x = this, Big = x.constructor, yBig = new Big(y);
261
+ if (x.s != yBig.s) {
262
+ yBig.s = negateSign(yBig.s);
263
+ return x.minus(yBig);
264
+ }
265
+ var xe = x.e, xc = x.c, ye = yBig.e, yc = yBig.c;
266
+ if (!xc[0] || !yc[0]) {
267
+ if (!yc[0]) if (xc[0]) yBig = new Big(x);
268
+ else yBig.s = x.s;
269
+ return yBig;
270
+ }
271
+ xc = xc.slice();
272
+ if (e = xe - ye) {
273
+ if (e > 0) {
274
+ ye = xe;
275
+ t = yc;
276
+ } else {
277
+ e = -e;
278
+ t = xc;
279
+ }
280
+ t.reverse();
281
+ for (; e--;) t.push(0);
282
+ t.reverse();
283
+ }
284
+ if (xc.length - yc.length < 0) {
285
+ t = yc;
286
+ yc = xc;
287
+ xc = t;
288
+ }
289
+ for (k = 0, e = yc.length; e;) {
290
+ --e;
291
+ k = (xc[e] = (xc[e] ?? 0) + (yc[e] ?? 0) + k) / 10 | 0;
292
+ xc[e] %= 10;
293
+ }
294
+ if (k) {
295
+ xc.unshift(k);
296
+ ++ye;
297
+ }
298
+ for (e = xc.length; xc[--e] === 0;) xc.pop();
299
+ yBig.c = xc;
300
+ yBig.e = ye;
301
+ return yBig;
302
+ };
303
+ P.pow = function(n) {
304
+ var x = this, one = new x.constructor("1"), y = one, isneg = n < 0;
305
+ if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) throw Error(INVALID + "exponent");
306
+ if (isneg) n = -n;
307
+ for (;;) {
308
+ if (n & 1) y = y.times(x);
309
+ n >>= 1;
310
+ if (!n) break;
311
+ x = x.times(x);
312
+ }
313
+ return isneg ? one.div(y) : y;
314
+ };
315
+ P.prec = function(sd, rm) {
316
+ if (sd !== ~~sd || sd < 1 || sd > MAX_DP) throw Error(INVALID + "precision");
317
+ return round(new this.constructor(this), sd, rm);
318
+ };
319
+ P.round = function(dp, rm) {
320
+ if (dp === UNDEFINED) dp = 0;
321
+ else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) throw Error(INVALID_DP);
322
+ return round(new this.constructor(this), dp + this.e + 1, rm);
323
+ };
324
+ P.sqrt = function() {
325
+ var r, c, t, x = this, Big = x.constructor, sign = x.s, e = x.e, half = new Big("0.5"), s;
326
+ if (!x.c[0]) return new Big(x);
327
+ if (sign < 0) throw Error(NAME + "No square root");
328
+ s = Math.sqrt(+stringify(x, true, true));
329
+ if (s === 0 || s === Infinity) {
330
+ c = x.c.join("");
331
+ if (!(c.length + e & 1)) c += "0";
332
+ s = Math.sqrt(+c);
333
+ e = ((e + 1) / 2 | 0) - (e < 0 || (e & 1) !== 0 ? 1 : 0);
334
+ if (s == Infinity) r = new Big("5e" + e);
335
+ else {
336
+ c = s.toExponential();
337
+ r = new Big(c.slice(0, c.indexOf("e") + 1) + e);
338
+ }
339
+ } else r = new Big(s + "");
340
+ e = r.e + (Big.DP += 4);
341
+ do {
342
+ t = r;
343
+ r = half.times(t.plus(x.div(t)));
344
+ } while (t.c.slice(0, e).join("") !== r.c.slice(0, e).join(""));
345
+ return round(r, (Big.DP -= 4) + r.e + 1, Big.RM);
346
+ };
347
+ P.times = P.mul = function(y) {
348
+ var c, x = this, Big = x.constructor, xc = x.c, yBig = new Big(y), yc = yBig.c, a = xc.length, b = yc.length, i = x.e, j = yBig.e;
349
+ yBig.s = x.s == yBig.s ? 1 : -1;
350
+ if (!xc[0] || !yc[0]) {
351
+ yBig.c = [yBig.e = 0];
352
+ return yBig;
353
+ }
354
+ yBig.e = i + j;
355
+ if (a < b) {
356
+ c = xc;
357
+ xc = yc;
358
+ yc = c;
359
+ j = a;
360
+ a = b;
361
+ b = j;
362
+ }
363
+ for (c = new Array(j = a + b); j--;) c[j] = 0;
364
+ for (i = b; i--;) {
365
+ b = 0;
366
+ for (j = a + i; j > i;) {
367
+ b = (c[j] ?? 0) + (yc[i] ?? 0) * (xc[j - i - 1] ?? 0) + b;
368
+ c[j--] = b % 10;
369
+ b = b / 10 | 0;
370
+ }
371
+ c[j] = b;
372
+ }
373
+ if (b) ++yBig.e;
374
+ else c.shift();
375
+ for (i = c.length; !c[--i];) c.pop();
376
+ yBig.c = c;
377
+ return yBig;
378
+ };
379
+ P.toExponential = function(dp, rm) {
380
+ var x = this, n = x.c[0];
381
+ if (dp !== UNDEFINED) {
382
+ if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP);
383
+ x = round(new x.constructor(x), ++dp, rm);
384
+ for (; x.c.length < dp;) x.c.push(0);
385
+ }
386
+ return stringify(x, true, !!n);
387
+ };
388
+ P.toFixed = function(dp, rm) {
389
+ var x = this, n = x.c[0];
390
+ if (dp !== UNDEFINED) {
391
+ if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP);
392
+ x = round(new x.constructor(x), dp + x.e + 1, rm);
393
+ for (dp = dp + x.e + 1; x.c.length < dp;) x.c.push(0);
394
+ }
395
+ return stringify(x, false, !!n);
396
+ };
397
+ P.toJSON = P.toString = function() {
398
+ var x = this, Big = x.constructor;
399
+ return stringify(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]);
400
+ };
401
+ if (typeof Symbol !== "undefined") P[Symbol.for("nodejs.util.inspect.custom")] = P.toJSON;
402
+ P.toNumber = function() {
403
+ var n = +stringify(this, true, true);
404
+ if (this.constructor.strict === true && !this.eq(n.toString())) throw Error(NAME + "Imprecise conversion");
405
+ return n;
406
+ };
407
+ P.toBigInt = function() {
408
+ const integer = this.round(0, 0);
409
+ if (!this.eq(integer)) throw Error(NAME + "BigInt conversion requires an integer value");
410
+ return BigInt(integer.toFixed(0));
411
+ };
412
+ P.toPrecision = function(sd, rm) {
413
+ var x = this, Big = x.constructor, n = x.c[0];
414
+ if (sd !== UNDEFINED) {
415
+ if (sd !== ~~sd || sd < 1 || sd > MAX_DP) throw Error(INVALID + "precision");
416
+ x = round(new Big(x), sd, rm);
417
+ for (; x.c.length < sd;) x.c.push(0);
418
+ }
419
+ return stringify(x, sd !== UNDEFINED && sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n);
420
+ };
421
+ P.valueOf = function() {
422
+ var x = this, Big = x.constructor;
423
+ if (Big.strict === true) throw Error(NAME + "valueOf disallowed");
424
+ return stringify(x, x.e <= Big.NE || x.e >= Big.PE, true);
425
+ };
426
+ const Big = _Big_();
427
+
428
+ //#endregion
429
+ exports.Big = Big;
430
+ exports.default = Big;
431
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["declare namespace Big {\n type BigSource = number | string | bigint | Big;\n\n /**\n * GT = 1, EQ = 0, LT = -1\n */\n type Comparison = -1 | 0 | 1;\n\n /**\n * RoundDown = 0, RoundHalfUp = 1, RoundHalfEven = 2, RoundUp = 3\n */\n type RoundingMode = 0 | 1 | 2 | 3;\n\n interface BigConstructor {\n /**\n * Returns a new instance of a Big number object\n *\n * String values may be in exponential, as well as normal (non-exponential) notation.\n * There is no limit to the number of digits of a string value (other than that of Javascript's maximum array size), but the largest recommended exponent magnitude is 1e+6.\n * Infinity, NaN and hexadecimal literal strings, e.g. '0xff', are not valid.\n * String values in octal literal form will be interpreted as decimals, e.g. '011' is 11, not 9.\n *\n * @throws `NaN` on an invalid value.\n */\n new(value: BigSource): Big;\n\n /**\n * Returns a new instance of a Big number object\n *\n * String values may be in exponential, as well as normal (non-exponential) notation.\n * There is no limit to the number of digits of a string value (other than that of Javascript's maximum array size), but the largest recommended exponent magnitude is 1e+6.\n * Infinity, NaN and hexadecimal literal strings, e.g. '0xff', are not valid.\n * String values in octal literal form will be interpreted as decimals, e.g. '011' is 11, not 9.\n *\n * @throws `NaN` on an invalid value.\n */\n (value: BigSource): Big;\n\n /**\n * Create an additional Big number constructor\n *\n * Values created with the returned constructor will have a separate set of configuration values.\n * This can be used to create Big objects with different DP and RM values.\n * Big numbers created by different constructors can be used together in operations, and it is the DP and RM setting of the Big number that an operation is called upon that will apply.\n * In the interest of memory efficiency, all Big number constructors share the same prototype object,\n * so while the DP and RM (and other own properties) of a constructor are isolated and untouchable by another, its prototype methods are not.\n */\n (): BigConstructor;\n\n /**\n * The maximum number of decimal places of the results of operations involving division.\n * It is relevant only to the div and sqrt methods, and the pow method when the exponent is negative.\n *\n * 0 to 1e+6 inclusive\n * Default value: 20\n */\n DP: number;\n /**\n * The rounding mode used in the above operations and by round, toExponential, toFixed and toPrecision.\n * Default value: 1\n */\n RM: number;\n /**\n * The negative exponent value at and below which toString returns exponential notation.\n *\n * -1e+6 to 0 inclusive\n * Default value: -7\n */\n NE: number;\n /**\n * The positive exponent value at and above which toString returns exponential notation.\n *\n * 0 to 1e+6 inclusive\n * Default value: 21\n */\n PE: number;\n /**\n * When set to true, an error will be thrown if a primitive number is passed to the Big constructor,\n * or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a primitive number without a loss of precision.\n *\n * true|false\n * Default value: false\n */\n strict: boolean;\n\n /** Readonly rounding modes */\n\n /**\n * Rounds towards zero.\n * I.e. truncate, no rounding.\n */\n readonly roundDown: 0;\n /**\n * Rounds towards nearest neighbour.\n * If equidistant, rounds away from zero.\n */\n readonly roundHalfUp: 1;\n /**\n * Rounds towards nearest neighbour.\n * If equidistant, rounds towards even neighbour.\n */\n readonly roundHalfEven: 2;\n /**\n * Rounds away from zero.\n */\n readonly roundUp: 3;\n\n readonly Big: BigConstructor;\n }\n\n interface Big {\n /** Returns a Big number whose value is the absolute value, i.e. the magnitude, of this Big number. */\n abs(): Big;\n /**\n * Returns a Big number whose value is the value of this Big number plus n - alias for .plus().\n *\n * @throws `NaN` if n is invalid.\n */\n add(n: BigSource): Big;\n /**\n * Compare the values.\n *\n * @throws `NaN` if n is invalid.\n */\n cmp(n: BigSource): Comparison;\n /**\n * Returns a Big number whose value is the value of this Big number divided by n.\n *\n * If the result has more fraction digits than is specified by Big.DP, it will be rounded to Big.DP decimal places using rounding mode Big.RM.\n *\n * @throws `NaN` if n is invalid.\n * @throws `±Infinity` on division by zero.\n * @throws `NaN` on division of zero by zero.\n */\n div(n: BigSource): Big;\n /**\n * Returns true if the value of this Big equals the value of n, otherwise returns false.\n *\n * @throws `NaN` if n is invalid.\n */\n eq(n: BigSource): boolean;\n /**\n * Returns true if the value of this Big is greater than the value of n, otherwise returns false.\n *\n * @throws `NaN` if n is invalid.\n */\n gt(n: BigSource): boolean;\n /**\n * Returns true if the value of this Big is greater than or equal to the value of n, otherwise returns false.\n *\n * @throws `NaN` if n is invalid.\n */\n gte(n: BigSource): boolean;\n /**\n * Returns true if the value of this Big is less than the value of n, otherwise returns false.\n *\n * @throws `NaN` if n is invalid.\n */\n lt(n: BigSource): boolean;\n /**\n * Returns true if the value of this Big is less than or equal to the value of n, otherwise returns false.\n *\n * @throws `NaN` if n is invalid.\n */\n lte(n: BigSource): boolean;\n /**\n * Returns a Big number whose value is the value of this Big number minus n.\n *\n * @throws `NaN` if n is invalid.\n */\n minus(n: BigSource): Big;\n /**\n * Returns a Big number whose value is the value of this Big number modulo n, i.e. the integer remainder of dividing this Big number by n.\n *\n * The result will have the same sign as this Big number, and it will match that of Javascript's % operator (within the limits of its precision) and BigDecimal's remainder method.\n *\n * @throws `NaN` if n is negative or otherwise invalid.\n */\n mod(n: BigSource): Big;\n /**\n * Returns a Big number whose value is the value of this Big number times n - alias for .times().\n *\n * @throws `NaN` if n is invalid.\n */\n mul(n: BigSource): Big;\n /**\n * Return a new Big whose value is the value of this Big negated.\n */\n neg(): Big;\n /**\n * Returns a Big number whose value is the value of this Big number plus n.\n *\n * @throws `NaN` if n is invalid.\n */\n plus(n: BigSource): Big;\n /**\n * Returns a Big number whose value is the value of this Big number raised to the power exp.\n *\n * If exp is negative and the result has more fraction digits than is specified by Big.DP, it will be rounded to Big.DP decimal places using rounding mode Big.RM.\n *\n * @param exp The power to raise the number to, -1e+6 to 1e+6 inclusive\n * @throws `!pow!` if exp is invalid.\n *\n * Note: High value exponents may cause this method to be slow to return.\n */\n pow(exp: number): Big;\n /**\n * Return a new Big whose value is the value of this Big rounded to a maximum precision of sd\n * significant digits using rounding mode rm, or Big.RM if rm is not specified.\n *\n * @param sd Significant digits: integer, 1 to MAX_DP inclusive.\n * @param rm Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n * @throws `!prec!` if sd is invalid.\n * @throws `!Big.RM!` if rm is invalid.\n */\n prec(sd: number, rm?: RoundingMode): Big;\n /**\n * Returns a Big number whose value is the value of this Big number rounded using rounding mode rm to a maximum of dp decimal places.\n *\n * @param dp Decimal places, 0 to 1e+6 inclusive\n * @param rm Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n * @throws `!round!` if dp is invalid.\n * @throws `!Big.RM!` if rm is invalid.\n */\n round(dp?: number, rm?: RoundingMode): Big;\n /**\n * Returns a Big number whose value is the square root of this Big number.\n *\n * If the result has more fraction digits than is specified by Big.DP, it will be rounded to Big.DP decimal places using rounding mode Big.RM.\n *\n * @throws `NaN` if this Big number is negative.\n */\n sqrt(): Big;\n /**\n * Returns a Big number whose value is the value of this Big number minus n - alias for .minus().\n *\n * @throws `NaN` if n is invalid.\n */\n sub(n: BigSource): Big;\n /**\n * Returns a Big number whose value is the value of this Big number times n.\n *\n * @throws `NaN` if n is invalid.\n */\n times(n: BigSource): Big;\n /**\n * Returns a string representing the value of this Big number in exponential notation to a fixed number of decimal places dp.\n *\n * If the value of this Big number in exponential notation has more digits to the right of the decimal point than is specified by dp,\n * the return value will be rounded to dp decimal places using rounding mode Big.RM.\n *\n * If the value of this Big number in exponential notation has fewer digits to the right of the decimal point than is specified by dp, the return value will be appended with zeros accordingly.\n *\n * If dp is omitted, or is null or undefined, the number of digits after the decimal point defaults to the minimum number of digits necessary to represent the value exactly.\n *\n * @param dp Decimal places, 0 to 1e+6 inclusive\n * @param rm Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n * @throws `!toFix!` if dp is invalid.\n */\n toExponential(dp?: number, rm?: RoundingMode): string;\n /**\n * Returns a string representing the value of this Big number in normal notation to a fixed number of decimal places dp.\n *\n * If the value of this Big number in normal notation has more digits to the right of the decimal point than is specified by dp,\n * the return value will be rounded to dp decimal places using rounding mode Big.RM.\n *\n * If the value of this Big number in normal notation has fewer fraction digits then is specified by dp, the return value will be appended with zeros accordingly.\n *\n * Unlike Number.prototype.toFixed, which returns exponential notation if a number is greater or equal to 1021, this method will always return normal notation.\n *\n * If dp is omitted, or is null or undefined, then the return value is simply the value in normal notation.\n * This is also unlike Number.prototype.toFixed, which returns the value to zero decimal places.\n *\n * @param dp Decimal places, 0 to 1e+6 inclusive\n * @param rm Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n * @throws `!toFix!` if dp is invalid.\n */\n toFixed(dp?: number, rm?: RoundingMode): string;\n /**\n * Returns a string representing the value of this Big number to the specified number of significant digits sd.\n *\n * If the value of this Big number has more digits than is specified by sd, the return value will be rounded to sd significant digits using rounding mode Big.RM.\n *\n * If the value of this Big number has fewer digits than is specified by sd, the return value will be appended with zeros accordingly.\n *\n * If sd is less than the number of digits necessary to represent the integer part of the value in normal notation, then exponential notation is used.\n *\n * If sd is omitted, or is null or undefined, then the return value is the same as .toString().\n *\n * @param sd Significant digits, 1 to 1e+6 inclusive\n * @param rm Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n * @throws `!toPre!` if sd is invalid.\n */\n toPrecision(sd?: number, rm?: RoundingMode): string;\n /**\n * Returns a string representing the value of this Big number.\n *\n * If this Big number has a positive exponent that is equal to or greater than 21, or a negative exponent equal to or less than -7, then exponential notation is returned.\n *\n * The point at which toString returns exponential rather than normal notation can be adjusted by changing\n * the value of Big.E_POS and Big.E_NEG. By default, Big numbers correspond to Javascript's number type in this regard.\n */\n toString(): string;\n /**\n * Returns a primitive number representing the value of this Big number.\n *\n * If Big.strict is true an error will be thrown if toNumber is called on a Big number which cannot be converted to a primitive number without a loss of precision.\n *\n * @since 6.0\n */\n toNumber(): number;\n /**\n * Returns a primitive bigint representing the value of this Big number.\n *\n * @throws if this Big number is not an integer.\n */\n toBigInt(): bigint;\n /**\n * Returns a string representing the value of this Big number.\n *\n * If this Big number has a positive exponent that is equal to or greater than 21, or a negative exponent equal to or less than -7, then exponential notation is returned.\n *\n * The point at which toString returns exponential rather than normal notation can be adjusted by changing\n * the value of Big.E_POS and Big.E_NEG. By default, Big numbers correspond to Javascript's number type in this regard.\n */\n valueOf(): string;\n /**\n * Returns a string representing the value of this Big number.\n *\n * If this Big number has a positive exponent that is equal to or greater than 21, or a negative exponent equal to or less than -7, then exponential notation is returned.\n *\n * The point at which toString returns exponential rather than normal notation can be adjusted by changing\n * the value of Big.E_POS and Big.E_NEG. By default, Big numbers correspond to Javascript's number type in this regard.\n */\n toJSON(): string;\n /**\n * Returns an array of single digits\n */\n c: number[];\n /**\n * Returns the exponent, Integer, -1e+6 to 1e+6 inclusive\n */\n e: number;\n /**\n * Returns the sign, -1 or 1\n */\n s: number;\n }\n}\n\ntype Big = Big.Big\ntype BigConstructor = Big.BigConstructor\n\nexport type BigSource = Big.BigSource\nexport type Comparison = Big.Comparison\nexport type RoundingMode = Big.RoundingMode\nexport type BigInstance = Big\n\ntype InternalSign = 1 | -1\ntype InternalDigits = number[]\ntype InternalSource = BigSource | InternalBig\n\ninterface InternalBig extends InternalBigProto {\n c: InternalDigits\n e: number\n s: InternalSign\n constructor: InternalBigConstructor\n}\n\ninterface InternalBigConstructor {\n (): InternalBigConstructor\n (value: InternalSource): InternalBig\n new (value: InternalSource): InternalBig\n DP: number\n RM: RoundingMode\n NE: number\n PE: number\n strict: boolean\n roundDown: 0\n roundHalfUp: 1\n roundHalfEven: 2\n roundUp: 3\n prototype: InternalBigProto\n}\n\ninterface InternalBigProto {\n abs(this: InternalBig): InternalBig\n cmp(this: InternalBig, y: InternalSource): Comparison\n div(this: InternalBig, y: InternalSource): InternalBig\n eq(this: InternalBig, y: InternalSource): boolean\n gt(this: InternalBig, y: InternalSource): boolean\n gte(this: InternalBig, y: InternalSource): boolean\n lt(this: InternalBig, y: InternalSource): boolean\n lte(this: InternalBig, y: InternalSource): boolean\n minus(this: InternalBig, y: InternalSource): InternalBig\n sub(this: InternalBig, y: InternalSource): InternalBig\n mod(this: InternalBig, y: InternalSource): InternalBig\n neg(this: InternalBig): InternalBig\n plus(this: InternalBig, y: InternalSource): InternalBig\n add(this: InternalBig, y: InternalSource): InternalBig\n pow(this: InternalBig, n: number): InternalBig\n prec(this: InternalBig, sd: number, rm?: RoundingMode): InternalBig\n round(this: InternalBig, dp?: number, rm?: RoundingMode): InternalBig\n sqrt(this: InternalBig): InternalBig\n times(this: InternalBig, y: InternalSource): InternalBig\n mul(this: InternalBig, y: InternalSource): InternalBig\n toExponential(this: InternalBig, dp?: number, rm?: RoundingMode): string\n toFixed(this: InternalBig, dp?: number, rm?: RoundingMode): string\n toJSON(this: InternalBig): string\n toString(this: InternalBig): string\n toNumber(this: InternalBig): number\n toBigInt(this: InternalBig): bigint\n toPrecision(this: InternalBig, sd?: number, rm?: RoundingMode): string\n valueOf(this: InternalBig): string\n [symbolKey: symbol]: ((this: InternalBig) => string) | undefined\n}\n\n/*\n * big.js v7.0.1\n * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.\n * Copyright (c) 2025 Michael Mclaughlin\n * https://github.com/MikeMcl/big.js/LICENCE.md\n */\n\n\n/************************************** EDITABLE DEFAULTS *****************************************/\n\n\n // The default values below must be integers within the stated ranges.\n\n /*\n * The maximum number of decimal places (DP) of the results of operations involving division:\n * div and sqrt, and pow with negative exponents.\n */\nvar DP = 20, // 0 to MAX_DP\n\n /*\n * The rounding mode (RM) used when rounding to the above decimal places.\n *\n * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN)\n * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP)\n * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)\n * 3 Away from zero. (ROUND_UP)\n */\n RM = 1 as RoundingMode, // 0, 1, 2 or 3\n\n // The maximum value of DP and Big.DP.\n MAX_DP = 1E6, // 0 to 1000000\n\n // The maximum magnitude of the exponent argument to the pow method.\n MAX_POWER = 1E6, // 1 to 1000000\n\n /*\n * The negative exponent (NE) at and beneath which toString returns exponential notation.\n * (JavaScript numbers: -7)\n * -1000000 is the minimum recommended exponent value of a Big.\n */\n NE = -7, // 0 to -1000000\n\n /*\n * The positive exponent (PE) at and above which toString returns exponential notation.\n * (JavaScript numbers: 21)\n * 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced.\n */\n PE = 21, // 0 to 1000000\n\n /*\n * When true, an error will be thrown if a primitive number is passed to the Big constructor,\n * or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a\n * primitive number without a loss of precision.\n */\n STRICT = false, // true or false\n\n\n/**************************************************************************************************/\n\n\n // Error messages.\n NAME = '[big.js] ',\n INVALID = NAME + 'Invalid ',\n INVALID_DP = INVALID + 'decimal places',\n INVALID_RM = INVALID + 'rounding mode',\n DIV_BY_ZERO = NAME + 'Division by zero',\n\n // The shared prototype object.\n P = {} as unknown as InternalBigProto,\n UNDEFINED = void 0,\n NUMERIC = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i;\n\n\n/*\n * Create and return a Big constructor.\n */\nfunction _Big_(): InternalBigConstructor {\n\n /*\n * The Big constructor and exported function.\n * Create and return a new instance of a Big number object.\n *\n * n {number|string|Big} A numeric value.\n */\n function Big(this: unknown, n?: InternalSource): InternalBig | InternalBigConstructor | void {\n const Ctor = Big as unknown as InternalBigConstructor\n const x = this as unknown\n\n // Enable constructor usage without new.\n if (!(x instanceof Ctor)) {\n return n === UNDEFINED && arguments.length === 0 ? _Big_() : new Ctor(n as InternalSource);\n }\n\n const instance = x as InternalBig\n\n // Duplicate.\n if (n instanceof Ctor) {\n instance.s = n.s;\n instance.e = n.e;\n instance.c = n.c.slice();\n } else {\n let value = n\n\n if (typeof value !== 'string') {\n if (Ctor.strict === true && typeof value !== 'bigint') {\n throw TypeError(INVALID + 'value');\n }\n\n // Minus zero?\n value = value === 0 && 1 / value < 0 ? '-0' : String(value);\n }\n\n parse(instance, value);\n }\n\n // Retain a reference to this Big constructor.\n // Shadow Big.prototype.constructor which points to Object.\n instance.constructor = Ctor;\n }\n\n const Ctor = Big as unknown as InternalBigConstructor\n\n Ctor.prototype = P;\n Ctor.DP = DP;\n Ctor.RM = RM;\n Ctor.NE = NE;\n Ctor.PE = PE;\n Ctor.strict = STRICT;\n Ctor.roundDown = 0;\n Ctor.roundHalfUp = 1;\n Ctor.roundHalfEven = 2;\n Ctor.roundUp = 3;\n\n return Ctor;\n}\n\nfunction negateSign(s: InternalSign): InternalSign {\n return s === 1 ? -1 : 1;\n}\n\n\n/*\n * Parse the number or string value passed to a Big constructor.\n *\n * x {Big} A Big number instance.\n * n {number|string} A numeric value.\n */\nfunction parse(x: InternalBig, n: string): InternalBig {\n var e, i, nl;\n\n if (!NUMERIC.test(n)) {\n throw Error(INVALID + 'number');\n }\n\n // Determine sign.\n x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;\n\n // Decimal point?\n if ((e = n.indexOf('.')) > -1) n = n.replace('.', '');\n\n // Exponential form?\n if ((i = n.search(/e/i)) > 0) {\n\n // Determine exponent.\n if (e < 0) e = i;\n e += +n.slice(i + 1);\n n = n.substring(0, i);\n } else if (e < 0) {\n\n // Integer.\n e = n.length;\n }\n\n nl = n.length;\n\n // Determine leading zeros.\n for (i = 0; i < nl && n.charAt(i) == '0';) ++i;\n\n if (i == nl) {\n\n // Zero.\n x.c = [x.e = 0];\n } else {\n\n // Determine trailing zeros.\n for (; nl > 0 && n.charAt(--nl) == '0';);\n x.e = e - i - 1;\n x.c = [];\n\n // Convert string to array of digits without leading/trailing zeros.\n for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);\n }\n\n return x;\n}\n\n\n/*\n * Round Big x to a maximum of sd significant digits using rounding mode rm.\n *\n * x {Big} The Big to round.\n * sd {number} Significant digits: integer, 0 to MAX_DP inclusive.\n * rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n * [more] {boolean} Whether the result of division was truncated.\n */\nfunction round(x: InternalBig, sd: number, rm?: RoundingMode, more?: boolean): InternalBig {\n var xc = x.c;\n var d0 = xc[0] ?? 0;\n\n if (rm === UNDEFINED) rm = x.constructor.RM;\n if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) {\n throw Error(INVALID_RM);\n }\n\n if (sd < 1) {\n more =\n rm === 3 && (more || !!xc[0]) || sd === 0 && (\n rm === 1 && d0 >= 5 ||\n rm === 2 && (d0 > 5 || d0 === 5 && (more || xc[1] !== UNDEFINED))\n );\n\n xc.length = 1;\n\n if (more) {\n\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\n x.e = x.e - sd + 1;\n xc[0] = 1;\n } else {\n\n // Zero.\n xc[0] = x.e = 0;\n }\n } else if (sd < xc.length) {\n d0 = xc[sd] ?? 0;\n\n // xc[sd] is the digit after the digit that may be rounded up.\n more =\n rm === 1 && d0 >= 5 ||\n rm === 2 && (d0 > 5 || d0 === 5 &&\n (more || xc[sd + 1] !== UNDEFINED || ((xc[sd - 1] ?? 0) & 1) === 1)) ||\n rm === 3 && (more || !!xc[0]);\n\n // Remove extra digits after the required precision.\n xc.length = sd;\n\n // Round up?\n if (more) {\n\n // Rounding up may mean the previous digit has to be rounded up.\n for (; ++(xc[--sd]!) > 9;) {\n xc[sd] = 0;\n if (sd === 0) {\n ++x.e;\n xc.unshift(1);\n break;\n }\n }\n }\n\n // Remove trailing zeros.\n for (sd = xc.length; !xc[--sd];) xc.pop();\n }\n\n return x;\n}\n\n\n/*\n * Return a string representing the value of Big x in normal or exponential notation.\n * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.\n */\nfunction stringify(x: InternalBig, doExponential: boolean, isNonzero: boolean): string {\n var e = x.e,\n s = x.c.join(''),\n n = s.length;\n\n // Exponential notation?\n if (doExponential) {\n s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;\n\n // Normal notation.\n } else if (e < 0) {\n for (; ++e;) s = '0' + s;\n s = '0.' + s;\n } else if (e > 0) {\n if (++e > n) {\n for (e -= n; e--;) s += '0';\n } else if (e < n) {\n s = s.slice(0, e) + '.' + s.slice(e);\n }\n } else if (n > 1) {\n s = s.charAt(0) + '.' + s.slice(1);\n }\n\n return x.s < 0 && isNonzero ? '-' + s : s;\n}\n\n\n// Prototype/instance methods\n\n\n/*\n * Return a new Big whose value is the absolute value of this Big.\n */\nP.abs = function (this: InternalBig) {\n var x = new this.constructor(this);\n x.s = 1;\n return x;\n};\n\n\n/*\n * Return 1 if the value of this Big is greater than the value of Big y,\n * -1 if the value of this Big is less than the value of Big y, or\n * 0 if they have the same value.\n */\nP.cmp = function (this: InternalBig, y: InternalSource): Comparison {\n var i, j,\n isneg,\n x = this,\n xc = x.c,\n yBig = new x.constructor(y),\n yc = yBig.c,\n xs = x.s,\n ys = yBig.s,\n k = x.e,\n l = yBig.e;\n\n // Either zero?\n if (!xc[0] || !yc[0]) return (!xc[0] ? !yc[0] ? 0 : negateSign(ys) : xs) as Comparison;\n\n // Signs differ?\n if (xs != ys) return xs as Comparison;\n\n isneg = xs < 0;\n\n // Compare exponents.\n if (k != l) return (((k > l ? 1 : 0) ^ (isneg ? 1 : 0)) ? 1 : -1) as Comparison;\n\n j = (k = xc.length) < (l = yc.length) ? k : l;\n\n // Compare digit by digit.\n for (i = -1; ++i < j;) {\n if (xc[i] != yc[i]) return (((xc[i]! > yc[i]! ? 1 : 0) ^ (isneg ? 1 : 0)) ? 1 : -1) as Comparison;\n }\n\n // Compare lengths.\n return (k == l ? 0 : ((k > l ? 1 : 0) ^ (isneg ? 1 : 0)) ? 1 : -1) as Comparison;\n};\n\n\n/*\n * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,\n * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\n */\nP.div = function (this: InternalBig, y: InternalSource): InternalBig {\n var x = this,\n Big = x.constructor,\n a = x.c, // dividend\n yBig = new Big(y),\n b = yBig.c, // divisor\n sign: InternalSign = x.s == yBig.s ? 1 : -1,\n dp = Big.DP;\n\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n\n // Divisor is zero?\n if (!b[0]) {\n throw Error(DIV_BY_ZERO);\n }\n\n // Dividend is 0? Return +-0.\n if (!a[0]) {\n yBig.s = sign;\n yBig.c = [yBig.e = 0];\n return yBig;\n }\n\n var bl, bt, n, cmp, ri,\n bz = b.slice(),\n ai = bl = b.length,\n al = a.length,\n r = a.slice(0, bl) as Array<number | undefined>, // remainder\n rl = r.length,\n q = yBig, // quotient\n qc = q.c = [] as InternalDigits,\n qi = 0,\n p = dp + (q.e = x.e - yBig.e) + 1, // precision of the result\n k = p < 0 ? 0 : p;\n\n q.s = sign;\n\n // Create version of divisor with leading zero.\n bz.unshift(0);\n\n // Add zeros to make remainder as long as divisor.\n for (; rl++ < bl;) r.push(0);\n\n do {\n\n // n is how many times the divisor goes into current remainder.\n for (n = 0; n < 10; n++) {\n\n // Compare divisor and remainder.\n if (bl != (rl = r.length)) {\n cmp = bl > rl ? 1 : -1;\n } else {\n for (ri = -1, cmp = 0; ++ri < bl;) {\n if (b[ri] != r[ri]) {\n cmp = b[ri]! > r[ri]! ? 1 : -1;\n break;\n }\n }\n }\n\n // If divisor < remainder, subtract divisor from remainder.\n if (cmp < 0) {\n\n // Remainder can't be more than 1 digit longer than divisor.\n // Equalise lengths using divisor with extra leading zero?\n for (bt = rl == bl ? b : bz; rl;) {\n if (r[--rl]! < bt[rl]!) {\n ri = rl;\n for (; ri && !r[--ri];) r[ri] = 9;\n --r[ri]!;\n r[rl] = (r[rl] ?? 0) + 10;\n }\n r[rl] = (r[rl] ?? 0) - bt[rl]!;\n }\n\n for (; !r[0];) r.shift();\n } else {\n break;\n }\n }\n\n // Add the digit n to the result array.\n qc[qi++] = cmp ? n : ++n;\n\n // Update the remainder.\n if (r[0] && cmp) r[rl] = a[ai] || 0;\n else r = [a[ai]];\n\n } while ((ai++ < al || r[0] !== UNDEFINED) && k--);\n\n // Leading zero? Do not remove if result is simply zero (qi == 1).\n if (!qc[0] && qi != 1) {\n\n // There can't be more than one zero.\n qc.shift();\n q.e--;\n p--;\n }\n\n // Round?\n if (qi > p) round(q, p, Big.RM, r[0] !== UNDEFINED);\n\n return q;\n};\n\n\n/*\n * Return true if the value of this Big is equal to the value of Big y, otherwise return false.\n */\nP.eq = function (this: InternalBig, y: InternalSource): boolean {\n return this.cmp(y) === 0;\n};\n\n\n/*\n * Return true if the value of this Big is greater than the value of Big y, otherwise return\n * false.\n */\nP.gt = function (this: InternalBig, y: InternalSource): boolean {\n return this.cmp(y) > 0;\n};\n\n\n/*\n * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise\n * return false.\n */\nP.gte = function (this: InternalBig, y: InternalSource): boolean {\n return this.cmp(y) > -1;\n};\n\n\n/*\n * Return true if the value of this Big is less than the value of Big y, otherwise return false.\n */\nP.lt = function (this: InternalBig, y: InternalSource): boolean {\n return this.cmp(y) < 0;\n};\n\n\n/*\n * Return true if the value of this Big is less than or equal to the value of Big y, otherwise\n * return false.\n */\nP.lte = function (this: InternalBig, y: InternalSource): boolean {\n return this.cmp(y) < 1;\n};\n\n\n/*\n * Return a new Big whose value is the value of this Big minus the value of Big y.\n */\nP.minus = P.sub = function (this: InternalBig, y: InternalSource): InternalBig {\n var i, j, t, xlty,\n x = this,\n Big = x.constructor,\n yBig = new Big(y),\n a = x.s,\n b = yBig.s;\n\n // Signs differ?\n if (a != b) {\n yBig.s = negateSign(b);\n return x.plus(yBig);\n }\n\n var xc = x.c.slice(),\n xe = x.e,\n yc = yBig.c,\n ye = yBig.e,\n aDiff = xe - ye;\n\n // Either zero?\n if (!xc[0] || !yc[0]) {\n if (yc[0]) {\n yBig.s = negateSign(b);\n } else if (xc[0]) {\n yBig = new Big(x);\n } else {\n yBig.s = 1;\n }\n return yBig;\n }\n\n // Determine which is the bigger number. Prepend zeros to equalise exponents.\n if (aDiff) {\n\n if (xlty = aDiff < 0) {\n aDiff = -aDiff;\n t = xc;\n } else {\n ye = xe;\n t = yc;\n }\n\n t.reverse();\n for (j = aDiff; j--;) t.push(0);\n t.reverse();\n } else {\n\n // Exponents equal. Check digit by digit.\n j = ((xlty = xc.length < yc.length) ? xc : yc).length;\n\n for (i = 0; i < j; i++) {\n if (xc[i] != yc[i]) {\n xlty = xc[i]! < yc[i]!;\n break;\n }\n }\n }\n\n // x < y? Point xc to the array of the bigger number.\n if (xlty) {\n t = xc;\n xc = yc;\n yc = t;\n yBig.s = negateSign(yBig.s);\n }\n\n /*\n * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only\n * needs to start at yc.length.\n */\n if ((j = yc.length - (i = xc.length)) > 0) for (; j--;) xc[i++] = 0;\n\n // Subtract yc from xc.\n for (j = i; j > aDiff;) {\n if (xc[--j]! < (yc[j] ?? 0)) {\n for (i = j; i && !xc[--i];) xc[i] = 9;\n --xc[i]!;\n xc[j] = (xc[j] ?? 0) + 10;\n }\n\n xc[j] = (xc[j] ?? 0) - (yc[j] ?? 0);\n }\n\n // Remove trailing zeros.\n for (j = xc.length; xc[--j] === 0;) xc.pop();\n\n // Remove leading zeros and adjust exponent accordingly.\n for (; xc[0] === 0;) {\n xc.shift();\n --ye;\n }\n\n if (!xc[0]) {\n\n // n - n = +0\n yBig.s = 1;\n\n // Result must be zero.\n xc = [ye = 0];\n }\n\n yBig.c = xc;\n yBig.e = ye;\n\n return yBig;\n};\n\n\n/*\n * Return a new Big whose value is the value of this Big modulo the value of Big y.\n */\nP.mod = function (this: InternalBig, y: InternalSource): InternalBig {\n var ygtx,\n x = this,\n Big = x.constructor,\n yBig = new Big(y),\n xSign = x.s,\n ySign = yBig.s,\n dp: number,\n rm: RoundingMode;\n\n if (!yBig.c[0]) {\n throw Error(DIV_BY_ZERO);\n }\n\n x.s = yBig.s = 1;\n ygtx = yBig.cmp(x) == 1;\n x.s = xSign;\n yBig.s = ySign;\n\n if (ygtx) return new Big(x);\n\n dp = Big.DP;\n rm = Big.RM;\n Big.DP = 0;\n Big.RM = 0;\n x = x.div(yBig);\n Big.DP = dp;\n Big.RM = rm;\n\n return this.minus(x.times(yBig));\n};\n\n\n/*\n * Return a new Big whose value is the value of this Big negated.\n */\nP.neg = function (this: InternalBig): InternalBig {\n var x = new this.constructor(this);\n x.s = negateSign(x.s);\n return x;\n};\n\n\n/*\n * Return a new Big whose value is the value of this Big plus the value of Big y.\n */\nP.plus = P.add = function (this: InternalBig, y: InternalSource): InternalBig {\n var e, k, t,\n x = this,\n Big = x.constructor,\n yBig = new Big(y);\n\n // Signs differ?\n if (x.s != yBig.s) {\n yBig.s = negateSign(yBig.s);\n return x.minus(yBig);\n }\n\n var xe = x.e,\n xc = x.c,\n ye = yBig.e,\n yc = yBig.c;\n\n // Either zero?\n if (!xc[0] || !yc[0]) {\n if (!yc[0]) {\n if (xc[0]) {\n yBig = new Big(x);\n } else {\n yBig.s = x.s;\n }\n }\n return yBig;\n }\n\n xc = xc.slice();\n\n // Prepend zeros to equalise exponents.\n // Note: reverse faster than unshifts.\n if (e = xe - ye) {\n if (e > 0) {\n ye = xe;\n t = yc;\n } else {\n e = -e;\n t = xc;\n }\n\n t.reverse();\n for (; e--;) t.push(0);\n t.reverse();\n }\n\n // Point xc to the longer array.\n if (xc.length - yc.length < 0) {\n t = yc;\n yc = xc;\n xc = t;\n }\n\n // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.\n for (k = 0, e = yc.length; e;) {\n --e;\n k = (xc[e] = (xc[e] ?? 0) + (yc[e] ?? 0) + k) / 10 | 0;\n xc[e]! %= 10;\n }\n\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\n\n if (k) {\n xc.unshift(k);\n ++ye;\n }\n\n // Remove trailing zeros.\n for (e = xc.length; xc[--e] === 0;) xc.pop();\n\n yBig.c = xc;\n yBig.e = ye;\n\n return yBig;\n};\n\n\n/*\n * Return a Big whose value is the value of this Big raised to the power n.\n * If n is negative, round to a maximum of Big.DP decimal places using rounding\n * mode Big.RM.\n *\n * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.\n */\nP.pow = function (this: InternalBig, n: number): InternalBig {\n var x = this,\n one = new x.constructor('1'),\n y = one,\n isneg = n < 0;\n\n if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) {\n throw Error(INVALID + 'exponent');\n }\n\n if (isneg) n = -n;\n\n for (;;) {\n if (n & 1) y = y.times(x);\n n >>= 1;\n if (!n) break;\n x = x.times(x);\n }\n\n return isneg ? one.div(y) : y;\n};\n\n\n/*\n * Return a new Big whose value is the value of this Big rounded to a maximum precision of sd\n * significant digits using rounding mode rm, or Big.RM if rm is not specified.\n *\n * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.prec = function (this: InternalBig, sd: number, rm?: RoundingMode): InternalBig {\n if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\n throw Error(INVALID + 'precision');\n }\n return round(new this.constructor(this), sd, rm);\n};\n\n\n/*\n * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places\n * using rounding mode rm, or Big.RM if rm is not specified.\n * If dp is negative, round to an integer which is a multiple of 10**-dp.\n * If dp is not specified, round to 0 decimal places.\n *\n * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.round = function (this: InternalBig, dp?: number, rm?: RoundingMode): InternalBig {\n if (dp === UNDEFINED) dp = 0;\n else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n return round(new this.constructor(this), dp + this.e + 1, rm);\n};\n\n\n/*\n * Return a new Big whose value is the square root of the value of this Big, rounded, if\n * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\n */\nP.sqrt = function (this: InternalBig): InternalBig {\n var r: InternalBig, c: string, t: InternalBig,\n x = this,\n Big = x.constructor,\n sign = x.s,\n e = x.e,\n half = new Big('0.5'),\n s: number;\n\n // Zero?\n if (!x.c[0]) return new Big(x);\n\n // Negative?\n if (sign < 0) {\n throw Error(NAME + 'No square root');\n }\n\n // Estimate.\n s = Math.sqrt(+stringify(x, true, true));\n\n // Math.sqrt underflow/overflow?\n // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.\n if (s === 0 || s === 1 / 0) {\n c = x.c.join('');\n if (!(c.length + e & 1)) c += '0';\n s = Math.sqrt(+c);\n e = ((e + 1) / 2 | 0) - ((e < 0 || (e & 1) !== 0) ? 1 : 0);\n if (s == 1 / 0) {\n r = new Big('5e' + e);\n } else {\n c = s.toExponential();\n r = new Big(c.slice(0, c.indexOf('e') + 1) + e);\n }\n } else {\n r = new Big(s + '');\n }\n\n e = r.e + (Big.DP += 4);\n\n // Newton-Raphson iteration.\n do {\n t = r;\n r = half.times(t.plus(x.div(t)));\n } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));\n\n return round(r, (Big.DP -= 4) + r.e + 1, Big.RM);\n};\n\n\n/*\n * Return a new Big whose value is the value of this Big times the value of Big y.\n */\nP.times = P.mul = function (this: InternalBig, y: InternalSource): InternalBig {\n var c: number[],\n x = this,\n Big = x.constructor,\n xc = x.c,\n yBig = new Big(y),\n yc = yBig.c,\n a = xc.length,\n b = yc.length,\n i = x.e,\n j = yBig.e;\n\n // Determine sign of result.\n yBig.s = x.s == yBig.s ? 1 : -1;\n\n // Return signed 0 if either 0.\n if (!xc[0] || !yc[0]) {\n yBig.c = [yBig.e = 0];\n return yBig;\n }\n\n // Initialise exponent of result as x.e + y.e.\n yBig.e = i + j;\n\n // If array xc has fewer digits than yc, swap xc and yc, and lengths.\n if (a < b) {\n c = xc;\n xc = yc;\n yc = c;\n j = a;\n a = b;\n b = j;\n }\n\n // Initialise coefficient array of result with zeros.\n for (c = new Array(j = a + b); j--;) c[j] = 0;\n\n // Multiply.\n\n // i is initially xc.length.\n for (i = b; i--;) {\n b = 0;\n\n // a is yc.length.\n for (j = a + i; j > i;) {\n\n // Current sum of products at this digit position, plus carry.\n b = (c[j] ?? 0) + (yc[i] ?? 0) * (xc[j - i - 1] ?? 0) + b;\n c[j--] = b % 10;\n\n // carry\n b = b / 10 | 0;\n }\n\n c[j] = b;\n }\n\n // Increment result exponent if there is a final carry, otherwise remove leading zero.\n if (b) ++yBig.e;\n else c.shift();\n\n // Remove trailing zeros.\n for (i = c.length; !c[--i];) c.pop();\n yBig.c = c;\n\n return yBig;\n};\n\n\n/*\n * Return a string representing the value of this Big in exponential notation rounded to dp fixed\n * decimal places using rounding mode rm, or Big.RM if rm is not specified.\n *\n * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.toExponential = function (this: InternalBig, dp?: number, rm?: RoundingMode): string {\n var x = this,\n n = x.c[0];\n\n if (dp !== UNDEFINED) {\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n x = round(new x.constructor(x), ++dp, rm);\n for (; x.c.length < dp;) x.c.push(0);\n }\n\n return stringify(x, true, !!n);\n};\n\n\n/*\n * Return a string representing the value of this Big in normal notation rounded to dp fixed\n * decimal places using rounding mode rm, or Big.RM if rm is not specified.\n *\n * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n *\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\n */\nP.toFixed = function (this: InternalBig, dp?: number, rm?: RoundingMode): string {\n var x = this,\n n = x.c[0];\n\n if (dp !== UNDEFINED) {\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n x = round(new x.constructor(x), dp + x.e + 1, rm);\n\n // x.e may have changed if the value is rounded up.\n for (dp = dp + x.e + 1; x.c.length < dp;) x.c.push(0);\n }\n\n return stringify(x, false, !!n);\n};\n\n\n/*\n * Return a string representing the value of this Big.\n * Return exponential notation if this Big has a positive exponent equal to or greater than\n * Big.PE, or a negative exponent equal to or less than Big.NE.\n * Omit the sign for negative zero.\n */\nP.toJSON = P.toString = function (this: InternalBig): string {\n var x = this,\n Big = x.constructor;\n return stringify(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]);\n};\n\nif (typeof Symbol !== \"undefined\") {\n P[Symbol.for('nodejs.util.inspect.custom')] = P.toJSON;\n}\n\n\n/*\n * Return the value of this Big as a primitive number.\n */\nP.toNumber = function (this: InternalBig): number {\n var n = +stringify(this, true, true);\n if (this.constructor.strict === true && !this.eq(n.toString())) {\n throw Error(NAME + 'Imprecise conversion');\n }\n return n;\n};\n\n/*\n * Return the value of this Big as a primitive bigint.\n */\nP.toBigInt = function (this: InternalBig): bigint {\n const integer = this.round(0, 0)\n\n if (!this.eq(integer)) {\n throw Error(NAME + 'BigInt conversion requires an integer value')\n }\n\n return BigInt(integer.toFixed(0))\n};\n\n\n/*\n * Return a string representing the value of this Big rounded to sd significant digits using\n * rounding mode rm, or Big.RM if rm is not specified.\n * Use exponential notation if sd is less than the number of digits necessary to represent\n * the integer part of the value in normal notation.\n *\n * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.toPrecision = function (this: InternalBig, sd?: number, rm?: RoundingMode): string {\n var x = this,\n Big = x.constructor,\n n = x.c[0];\n\n if (sd !== UNDEFINED) {\n if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\n throw Error(INVALID + 'precision');\n }\n x = round(new Big(x), sd, rm);\n for (; x.c.length < sd;) x.c.push(0);\n }\n\n return stringify(x, (sd !== UNDEFINED && sd <= x.e) || x.e <= Big.NE || x.e >= Big.PE, !!n);\n};\n\n\n/*\n * Return a string representing the value of this Big.\n * Return exponential notation if this Big has a positive exponent equal to or greater than\n * Big.PE, or a negative exponent equal to or less than Big.NE.\n * Include the sign for negative zero.\n */\nP.valueOf = function (this: InternalBig): string {\n var x = this,\n Big = x.constructor;\n if (Big.strict === true) {\n throw Error(NAME + 'valueOf disallowed');\n }\n return stringify(x, x.e <= Big.NE || x.e >= Big.PE, true);\n};\n\nconst Big = _Big_() as unknown as BigConstructor\nexport { Big }\nexport default Big\n"],"mappings":";;;;AAkbA,IAAI,KAAK,IAUP,KAAK,GAGL,SAAS,KAGT,YAAY,KAOZ,KAAK,IAOL,KAAK,IAOL,SAAS,OAOT,OAAO,aACP,UAAU,OAAO,YACjB,aAAa,UAAU,kBACvB,aAAa,UAAU,iBACvB,cAAc,OAAO,oBAGrB,IAAI,EAAE,EACN,YAAY,KAAK,GACjB,UA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