2532 lines
60 KiB
JavaScript
2532 lines
60 KiB
JavaScript
// Metro module 5671 (f5672).
|
|
function $mk104609($env) {
|
|
return function Decimal(a0) {
|
|
"use strict";
|
|
let r16, r43, r54;
|
|
const constructor = $env[0];
|
|
if (this instanceof constructor) {
|
|
this.constructor = constructor;
|
|
if (a0 instanceof constructor) {
|
|
this.s = a0.s;
|
|
this.e = a0.e;
|
|
const r65 = a0.d;
|
|
this.d = r65 && r65.slice();
|
|
return void 0;
|
|
}
|
|
if (typeof a0 === "number") {
|
|
if (0 * a0 !== 0) {
|
|
throw Error($env.$parent[4] + a0);
|
|
}
|
|
if (a0 > 0) {
|
|
this.s = 1;
|
|
r43 = a0;
|
|
} else {
|
|
if (!(a0 < 0)) {
|
|
this.s = 0;
|
|
this.e = 0;
|
|
this.d = [0];
|
|
return void 0;
|
|
}
|
|
r43 = -a0;
|
|
this.s = -1;
|
|
}
|
|
if (r43 === ~~r43 && r43 < 10000000) {
|
|
this.e = 0;
|
|
this.d = [r43];
|
|
r54 = void 0;
|
|
} else {
|
|
(0, $env.$parent[17])(this, r43.toString());
|
|
r54 = this;
|
|
}
|
|
return r54;
|
|
}
|
|
if (typeof a0 !== "string") {
|
|
throw Error($env.$parent[4] + a0);
|
|
}
|
|
if (a0.charCodeAt(0) === 45) {
|
|
r16 = a0.slice(1);
|
|
this.s = -1;
|
|
} else {
|
|
this.s = 1;
|
|
r16 = a0;
|
|
}
|
|
const r20 = $env.$parent;
|
|
if (r20[8].test(r16)) {
|
|
(0, r20[17])(this, r16);
|
|
return void 0;
|
|
}
|
|
throw Error(r20[4] + r16);
|
|
}
|
|
const r7 = {
|
|
__proto__: constructor.prototype
|
|
};
|
|
const r10 = constructor.call(r7, a0);
|
|
return r10 instanceof Object ? r10 : r7;
|
|
};
|
|
}
|
|
let digitsToString, exp, ln, parseDecimal, round, subtract, toString, config, c3508_3, c3508_4, c3508_5, floor, pow, c3508_8, c3508_9, c3508_10, c3508_11, c3508_14, clone, c3509_0, c3508_0;
|
|
let env3508;
|
|
let env3509;
|
|
const r5 = env3508 = {};
|
|
const add = function add(a0, a1) {
|
|
"use strict";
|
|
let r33, r34, r50, r76, length;
|
|
const constructor = a0.constructor;
|
|
const precision = constructor.precision;
|
|
if (a0.s && a1.s) {
|
|
const r29 = a0.d;
|
|
const r14 = a1.d;
|
|
let r30 = a0.e;
|
|
const r16 = a1.e;
|
|
const r15 = r29.slice();
|
|
const r17 = r30 - r16;
|
|
let r32 = r16;
|
|
if (r17) {
|
|
if (r17 < 0) {
|
|
r33 = -r17;
|
|
length = r14.length;
|
|
r30 = r16;
|
|
r34 = r15;
|
|
} else {
|
|
length = r15.length;
|
|
r33 = r17;
|
|
r34 = r14;
|
|
}
|
|
const r39 = Math.ceil(precision / 7);
|
|
const r41 = r39 > length ? r39 + 1 : length + 1;
|
|
if (r33 > r41) {
|
|
r34.length = 1;
|
|
r33 = r41;
|
|
}
|
|
r34.reverse();
|
|
const r46 = +r33;
|
|
let r47 = r46 - 1;
|
|
if (r46) {
|
|
do {
|
|
r34.push(0);
|
|
r50 = +r47;
|
|
r47 = r50 - 1;
|
|
} while (r50);
|
|
}
|
|
r34.reverse();
|
|
r32 = r30;
|
|
}
|
|
const length2 = r15.length;
|
|
let length3 = r14.length;
|
|
const r55 = length2 - length3;
|
|
let r57 = r14;
|
|
let r58 = r15;
|
|
if (r55 < 0) {
|
|
r57 = r15;
|
|
r58 = r14;
|
|
length3 = length2;
|
|
}
|
|
let r0 = 0;
|
|
let r59 = 0;
|
|
while (length3) {
|
|
const r60 = length3 - 1;
|
|
const r64 = r58[r60] + r57[r60] + r0;
|
|
r58[r60] = r64;
|
|
r0 = r64 / c3508_9 | 0;
|
|
r58[r60] = r58[r60] % c3508_9;
|
|
r59 = r0;
|
|
length3 = r60;
|
|
}
|
|
let r67 = r32;
|
|
if (r59) {
|
|
r58.unshift(r59);
|
|
r67 = r32 + 1;
|
|
}
|
|
let r71 = r58.length - 1;
|
|
if (r58[r71] == 0) {
|
|
do {
|
|
r58.pop();
|
|
const r75 = r71 - 1;
|
|
r76 = r58[r75];
|
|
r71 = r75;
|
|
} while (r76 == 0);
|
|
}
|
|
a1.d = r58;
|
|
a1.e = r67;
|
|
if (env3508[2]) {
|
|
round(a1, precision);
|
|
}
|
|
return a1;
|
|
}
|
|
const r23 = a1.s ? a1 : new constructor(a0);
|
|
if (env3508[2]) {
|
|
round(r23, precision);
|
|
}
|
|
return r23;
|
|
};
|
|
digitsToString = function digitsToString(a0) {
|
|
"use strict";
|
|
let r11, r22, r27, r36, r42;
|
|
const r8 = a0.length - 1;
|
|
const r12 = a0[0];
|
|
if (0 < r8) {
|
|
let r15 = "" + r12;
|
|
let r5 = 1;
|
|
let r24 = r15;
|
|
let r4 = 1;
|
|
while (r4 < r8) {
|
|
const r18 = "" + a0[r5];
|
|
const r3 = 7 - r18.length;
|
|
const r20 = r15;
|
|
const r7 = r5;
|
|
let r26 = r20;
|
|
if (r3) {
|
|
let r0 = r3 - 1;
|
|
let r21 = "";
|
|
let r19 = "";
|
|
if (r3) {
|
|
do {
|
|
r21 = r21 + "0";
|
|
const r1 = r0 - 1;
|
|
r27 = r0;
|
|
r0 = r1;
|
|
r19 = r21;
|
|
} while (r27);
|
|
}
|
|
r26 = r20 + r19;
|
|
}
|
|
r15 = r26 + r18;
|
|
r5 = r7 + 1;
|
|
r24 = r15;
|
|
r4 = r5;
|
|
}
|
|
const r28 = a0[r4];
|
|
const r31 = 7 - ("" + r28).length;
|
|
r22 = r28;
|
|
r11 = r24;
|
|
if (r31) {
|
|
let r32 = r31 - 1;
|
|
let r33 = "";
|
|
let r34 = "";
|
|
if (r31) {
|
|
do {
|
|
r33 = r33 + "0";
|
|
const r35 = r32 - 1;
|
|
r36 = r32;
|
|
r32 = r35;
|
|
r34 = r33;
|
|
} while (r36);
|
|
}
|
|
r11 = r24 + r34;
|
|
r22 = r28;
|
|
}
|
|
} else {
|
|
r11 = "";
|
|
r22 = r12;
|
|
if (r22 === 0) {
|
|
return "0";
|
|
}
|
|
}
|
|
const r38 = r22 % 10;
|
|
let r39 = r22;
|
|
let r40 = r39;
|
|
if (r38 === 0) {
|
|
do {
|
|
const r41 = r39 / 10;
|
|
r42 = r41 % 10;
|
|
r39 = r41;
|
|
r40 = r39;
|
|
} while (r42 === 0);
|
|
}
|
|
return r11 + r40;
|
|
};
|
|
exp = function exp(a0, a1) {
|
|
"use strict";
|
|
let r53, r100;
|
|
const constructor = a0.constructor;
|
|
const precision = constructor.precision;
|
|
let r1 = 7 * a0.e;
|
|
let r33 = a0.d[0];
|
|
let r0 = r1;
|
|
if (r33 >= 10) {
|
|
do {
|
|
r1 = r1 + 1;
|
|
r33 = r33 / 10;
|
|
r0 = r1;
|
|
} while (10 <= r33);
|
|
}
|
|
if (16 < r0) {
|
|
const r104 = Error;
|
|
let r107 = 7 * a0.e;
|
|
let r109 = a0.d[0];
|
|
let r110 = r107;
|
|
if (r109 >= 10) {
|
|
do {
|
|
r107 = r107 + 1;
|
|
r109 = r109 / 10;
|
|
r110 = r107;
|
|
} while (10 <= r109);
|
|
}
|
|
throw r104(c3508_5 + r110);
|
|
}
|
|
if (!a0.s) {
|
|
return new constructor(c3508_0);
|
|
}
|
|
const r38 = null == void 0;
|
|
let r39 = void 0;
|
|
if (r38) {
|
|
env3508[2] = false;
|
|
r39 = precision;
|
|
}
|
|
const r19 = new constructor(0.03125);
|
|
const r46 = a0.abs().gte(0.1);
|
|
let r47 = 0;
|
|
let r48 = a0;
|
|
let r49 = 0;
|
|
let r24 = a0;
|
|
if (r46) {
|
|
do {
|
|
const r20 = r48.times(r19);
|
|
r47 = r47 + 5;
|
|
r53 = r20.abs().gte(0.1);
|
|
r48 = r20;
|
|
r49 = r47;
|
|
r24 = r48;
|
|
} while (r53);
|
|
}
|
|
const precision2 = r39 + (Math.log(pow(2, r49)) / Math.LN10 * 2 + 5 | 0);
|
|
let r23 = new constructor(c3508_0);
|
|
constructor.precision = precision2;
|
|
let r72 = 0;
|
|
let r22 = r23;
|
|
let r73 = r22;
|
|
while (true) {
|
|
let r74 = round;
|
|
const r26 = r22.times(r24);
|
|
r74(r26, precision2);
|
|
const times = r73.times;
|
|
const r78 = r72 + 1;
|
|
const r25 = times.call(r73, r78);
|
|
const r27 = r23.plus(c3508_14(r26, r25, precision2));
|
|
const r86 = digitsToString(r27.d).slice(0, precision2);
|
|
const r90 = digitsToString(r23.d).slice(0, precision2);
|
|
const r91 = r23;
|
|
r72 = r78;
|
|
r23 = r27;
|
|
r22 = r26;
|
|
r73 = r25;
|
|
if (r86 === r90) {
|
|
let r92 = r49 - 1;
|
|
let r93 = r91;
|
|
let r94 = r93;
|
|
if (r49) {
|
|
do {
|
|
const r97 = r93.times(r93);
|
|
round(r97, precision2);
|
|
const r99 = r92 - 1;
|
|
r100 = r92;
|
|
r92 = r99;
|
|
r93 = r97;
|
|
r94 = r93;
|
|
r74 = round;
|
|
} while (r100);
|
|
}
|
|
constructor.precision = precision;
|
|
let r101 = r94;
|
|
if (r38) {
|
|
env3508[2] = true;
|
|
r101 = r74(r94, precision);
|
|
}
|
|
return r101;
|
|
}
|
|
}
|
|
};
|
|
ln = function ln(a0, a1) {
|
|
"use strict";
|
|
let r2, r79, r81, r82, r83, r84, r111, r112;
|
|
const { d: r17, constructor } = a0;
|
|
const precision = constructor.precision;
|
|
if (a0.s < 1) {
|
|
throw Error(c3508_3 + (a0.s ? "NaN" : "-Infinity"));
|
|
}
|
|
if (a0.eq(c3508_0)) {
|
|
return new constructor(0);
|
|
}
|
|
let r34 = a1;
|
|
const r35 = a1 == null;
|
|
if (r35) {
|
|
env3508[2] = false;
|
|
r34 = precision;
|
|
}
|
|
if (a0.eq(10)) {
|
|
if (r35) {
|
|
env3508[2] = true;
|
|
}
|
|
if (r34 > constructor.LN10.sd()) {
|
|
env3508[2] = true;
|
|
throw Error("[DecimalError] LN10 precision limit exceeded");
|
|
}
|
|
const r194 = new constructor(constructor.LN10);
|
|
round(r194, r34);
|
|
return r194;
|
|
}
|
|
const precision2 = r34 + 10;
|
|
constructor.precision = precision2;
|
|
const r20 = digitsToString(r17);
|
|
const r23 = r20.charAt(0);
|
|
let r1 = 7 * a0.e;
|
|
let r42 = a0.d[0];
|
|
let r5 = r1;
|
|
if (r42 >= 10) {
|
|
do {
|
|
r1 = r1 + 1;
|
|
r42 = r42 / 10;
|
|
r5 = r1;
|
|
} while (10 <= r42);
|
|
}
|
|
if (!(Math.abs(r5) < 1500000000000000)) {
|
|
const r48 = precision2 + 2;
|
|
if (r48 > constructor.LN10.sd()) {
|
|
env3508[2] = true;
|
|
if (precision) {
|
|
constructor.precision = precision;
|
|
}
|
|
throw Error("[DecimalError] LN10 precision limit exceeded");
|
|
}
|
|
const r53 = new constructor(constructor.LN10);
|
|
round(r53, r48);
|
|
const r58 = r53.times("" + r5);
|
|
const r71 = ln(new constructor(r23 + "." + r20.slice(1)), precision2 - 10).plus(r58);
|
|
constructor.precision = precision;
|
|
if (r35) {
|
|
env3508[2] = true;
|
|
round(r71, precision);
|
|
}
|
|
return r71;
|
|
}
|
|
L23: {
|
|
L19: {
|
|
if (r23 < 7) {
|
|
const r78 = r23 != 1;
|
|
r79 = a0;
|
|
r2 = 1;
|
|
if (r78) {
|
|
break L19;
|
|
}
|
|
}
|
|
const r80 = r23 == 1;
|
|
r81 = a0;
|
|
r82 = 1;
|
|
r83 = r23;
|
|
r84 = r20;
|
|
if (!r80) {
|
|
break L23;
|
|
}
|
|
const r88 = r20.charAt(1) > 3;
|
|
r79 = a0;
|
|
r2 = 1;
|
|
r81 = a0;
|
|
r82 = 1;
|
|
r83 = r23;
|
|
r84 = r20;
|
|
if (!r88) {
|
|
break L23;
|
|
}
|
|
}
|
|
while (true) {
|
|
const r25 = r79.times(a0);
|
|
const r92 = digitsToString(r25.d);
|
|
const r94 = r92.charAt(0);
|
|
const r7 = r2 + 1;
|
|
if (r94 < 7) {
|
|
r79 = r25;
|
|
r2 = r7;
|
|
if (r94 != 1) {
|
|
continue;
|
|
}
|
|
}
|
|
r81 = r25;
|
|
r82 = r7;
|
|
r83 = r94;
|
|
r84 = r92;
|
|
if (r94 != 1) {
|
|
break;
|
|
}
|
|
const r96 = r92.charAt(1);
|
|
r79 = r25;
|
|
r2 = r7;
|
|
r81 = r79;
|
|
r82 = r2;
|
|
r83 = r94;
|
|
r84 = r92;
|
|
if (!(r96 > 3)) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
let r99 = 7 * r81.e;
|
|
let r101 = r81.d[0];
|
|
let r102 = r99;
|
|
if (r101 >= 10) {
|
|
do {
|
|
r99 = r99 + 1;
|
|
r101 = r101 / 10;
|
|
r102 = r99;
|
|
} while (10 <= r101);
|
|
}
|
|
if (r83 > 1) {
|
|
r111 = new constructor("0." + r84);
|
|
r112 = r102 + 1;
|
|
} else {
|
|
r111 = new constructor(r83 + "." + r84.slice(1));
|
|
r112 = r102;
|
|
}
|
|
const minus = r111.minus;
|
|
const r124 = c3508_14(minus.call(r111, c3508_0), r111.plus(c3508_0), precision2);
|
|
const r127 = r124.times(r124);
|
|
round(r127, precision2);
|
|
let r130 = 3;
|
|
let r132 = r124;
|
|
let r133 = r132;
|
|
while (true) {
|
|
const r136 = r133.times(r127);
|
|
round(r136, precision2);
|
|
const plus = r132.plus;
|
|
const r145 = plus.call(r132, c3508_14(r136, new constructor(r130), precision2));
|
|
const r149 = digitsToString(r145.d).slice(0, precision2);
|
|
const r153 = digitsToString(r132.d).slice(0, precision2);
|
|
const r154 = r132;
|
|
const r155 = r130;
|
|
if (r149 === r153) {
|
|
const r157 = r154.times(2);
|
|
let r158 = r157;
|
|
if (r112 !== 0) {
|
|
const r160 = precision2 + 2;
|
|
if (r160 > constructor.LN10.sd()) {
|
|
env3508[2] = true;
|
|
if (precision) {
|
|
constructor.precision = precision;
|
|
}
|
|
throw Error("[DecimalError] LN10 precision limit exceeded");
|
|
}
|
|
const r168 = new constructor(constructor.LN10);
|
|
round(r168, r160);
|
|
r158 = r157.plus(r168.times("" + r112));
|
|
}
|
|
const r178 = c3508_14(r158, new constructor(r82), precision2);
|
|
constructor.precision = precision;
|
|
if (r35) {
|
|
env3508[2] = true;
|
|
round(r178, precision);
|
|
}
|
|
return r178;
|
|
}
|
|
r130 = r155 + 2;
|
|
r132 = r145;
|
|
r133 = r136;
|
|
}
|
|
};
|
|
parseDecimal = function parseDecimal(a0, a1) {
|
|
"use strict";
|
|
let r23, r24, r36, r46, r63, r64, r87;
|
|
const r14 = a1.indexOf(".");
|
|
const r18 = r14 > -1 ? a1.replace(".", "") : a1;
|
|
const r21 = r18.search(/e/i);
|
|
if (r21 > 0) {
|
|
r24 = (r14 < 0 ? r21 : r14) + +r18.slice(r21 + 1);
|
|
r23 = r18.substring(0, r21);
|
|
} else {
|
|
r23 = r18;
|
|
r24 = r14;
|
|
if (r24 < 0) {
|
|
r24 = r18.length;
|
|
r23 = r18;
|
|
}
|
|
}
|
|
const r32 = r23.charCodeAt(0);
|
|
const r33 = r23;
|
|
let r0 = 0;
|
|
let r34 = 0;
|
|
if (r32 === 48) {
|
|
do {
|
|
const r2 = r0 + 1;
|
|
r36 = r33.charCodeAt(r2);
|
|
r0 = r2;
|
|
r34 = r0;
|
|
} while (r36 === 48);
|
|
}
|
|
const length = r33.length;
|
|
const r40 = r33.charCodeAt(length - 1);
|
|
let r41 = length;
|
|
let r42 = r41;
|
|
if (r40 === 48) {
|
|
do {
|
|
const r43 = r41 - 1;
|
|
r46 = r33.charCodeAt(r43 - 1);
|
|
r41 = r43;
|
|
r42 = r41;
|
|
} while (r46 === 48);
|
|
}
|
|
L28: {
|
|
const r49 = r33.slice(r34, r42);
|
|
const r50 = r42;
|
|
if (r49) {
|
|
const r1 = r50 - r34;
|
|
const r54 = r24 - r34 - 1;
|
|
a0.e = floor(r54 / 7);
|
|
a0.d = [];
|
|
const r61 = (r54 + 1) % 7;
|
|
const r62 = r54 < 0 ? r61 + 7 : r61;
|
|
if (r62 < r1) {
|
|
if (r62) {
|
|
a0.d.push(+r49.slice(0, r62));
|
|
}
|
|
const r71 = r1 - 7;
|
|
let r72 = r62;
|
|
let r73 = r72;
|
|
while (r73 < r71) {
|
|
const r74 = a0.d;
|
|
const r4 = r72 + 7;
|
|
r74.push(+r49.slice(r72, r4));
|
|
r72 = r4;
|
|
r73 = r72;
|
|
}
|
|
const r80 = r49.slice(r73);
|
|
r63 = 7 - r80.length;
|
|
r64 = r80;
|
|
} else {
|
|
r63 = r62 - r1;
|
|
r64 = r49;
|
|
}
|
|
let r82 = r63 - 1;
|
|
let r84 = r64;
|
|
let r85 = r84;
|
|
if (r63) {
|
|
do {
|
|
r84 = r84 + "0";
|
|
const r86 = r82 - 1;
|
|
r87 = r82;
|
|
r82 = r86;
|
|
r85 = r84;
|
|
} while (r87);
|
|
}
|
|
a0.d.push(+r85);
|
|
if (env3508[2]) {
|
|
const r92 = a0.e;
|
|
if (!(r92 > c3508_10) && !(a0.e < -c3508_10)) {
|
|
break L28;
|
|
}
|
|
throw Error(c3508_5 + r54);
|
|
}
|
|
} else {
|
|
a0.s = 0;
|
|
a0.e = 0;
|
|
a0.d = [0];
|
|
}
|
|
}
|
|
return a0;
|
|
};
|
|
round = function round(a0, a1, a2) {
|
|
"use strict";
|
|
let r22, r23, r38, r39, r52, r71, r80, r99, length;
|
|
const r16 = a0.d;
|
|
let r14 = r16[0];
|
|
const r11 = r14 >= 10;
|
|
let r3 = 1;
|
|
let r6 = 1;
|
|
if (r11) {
|
|
do {
|
|
r3 = r3 + 1;
|
|
r14 = r14 / 10;
|
|
r6 = r3;
|
|
} while (10 <= r14);
|
|
}
|
|
const r7 = a1 - r6;
|
|
if (r7 < 0) {
|
|
r39 = r7 + 7;
|
|
r23 = r16[0];
|
|
length = 0;
|
|
r38 = r6;
|
|
r22 = a1;
|
|
} else {
|
|
const r34 = Math.ceil((r7 + 1) / 7);
|
|
if (r34 >= r16.length) {
|
|
return a0;
|
|
}
|
|
r23 = r16[r34];
|
|
const r36 = r23 >= 10;
|
|
let r0 = 1;
|
|
let r37 = r23;
|
|
r38 = 1;
|
|
if (r36) {
|
|
do {
|
|
r0 = r0 + 1;
|
|
r37 = r37 / 10;
|
|
r38 = r0;
|
|
} while (10 <= r37);
|
|
}
|
|
r39 = r7 % 7;
|
|
r22 = r39 - 7 + r38;
|
|
length = r34;
|
|
}
|
|
let r44 = void 0;
|
|
if (a2 !== void 0) {
|
|
const r18 = pow(10, r38 - r22 - 1);
|
|
let r48 = r23 / r18 % 10 | 0;
|
|
const r24 = a1 < 0 || r16[length + 1] !== void 0 || r23 % r18;
|
|
if (a2 < 4) {
|
|
if (!r48) {
|
|
r48 = r24;
|
|
}
|
|
if (r48) {
|
|
r48 = a2 == 0 || a2 == (a0.s < 0 ? 3 : 2);
|
|
}
|
|
r52 = r48;
|
|
} else {
|
|
r52 = r48 > 5;
|
|
if (!(5 < r48)) {
|
|
r52 = r48 === 5 ? a2 == 4 || r24 || a2 == 6 && (0 < r39 ? r22 > 0 ? r23 / pow(10, r38 - r22) : 0 : r16[length - 1]) % 10 & 1 || a2 == (a0.s < 0 ? 8 : 7) : r48 === 5;
|
|
}
|
|
}
|
|
r44 = r52;
|
|
}
|
|
if (!(a1 < 1) && r16[0]) {
|
|
if (r39 === 0) {
|
|
r16.length = length;
|
|
r80 = length - 1;
|
|
r71 = 1;
|
|
} else {
|
|
r16.length = length + 1;
|
|
r71 = pow(10, 7 - r39);
|
|
r16[length] = r22 > 0 ? (r23 / pow(10, r38 - r22) % pow(10, r22) | 0) * r71 : 0;
|
|
r80 = length;
|
|
}
|
|
if (r44) {
|
|
while (true) {
|
|
const r81 = r80;
|
|
const r82 = r71;
|
|
if (r81 == 0) {
|
|
const r89 = r16[0] + r82;
|
|
r16[0] = r89;
|
|
if (r89 != c3508_9) {
|
|
break;
|
|
}
|
|
r16[0] = 1;
|
|
a0.e = a0.e + 1;
|
|
break;
|
|
}
|
|
r16[r81] = r16[r81] + r82;
|
|
if (r16[r81] != c3508_9) {
|
|
break;
|
|
}
|
|
const r87 = +r81;
|
|
r80 = r87 - 1;
|
|
r16[r87] = 0;
|
|
r71 = 1;
|
|
}
|
|
}
|
|
let r94 = r16.length - 1;
|
|
if (r16[r94] === 0) {
|
|
do {
|
|
r16.pop();
|
|
const r98 = r94 - 1;
|
|
r99 = r16[r98];
|
|
r94 = r98;
|
|
} while (r99 === 0);
|
|
}
|
|
L63: {
|
|
if (env3508[2]) {
|
|
const r101 = a0.e;
|
|
if (!(r101 > c3508_10) && !(a0.e < -c3508_10)) {
|
|
break L63;
|
|
}
|
|
const r106 = Error;
|
|
let r110 = 7 * a0.e;
|
|
let r112 = a0.d[0];
|
|
let r113 = r110;
|
|
if (r112 >= 10) {
|
|
do {
|
|
r110 = r110 + 1;
|
|
r112 = r112 / 10;
|
|
r113 = r110;
|
|
} while (10 <= r112);
|
|
}
|
|
throw r106(c3508_5 + r113);
|
|
}
|
|
}
|
|
return a0;
|
|
}
|
|
if (r44) {
|
|
let r118 = 7 * a0.e;
|
|
let r120 = a0.d[0];
|
|
let r121 = r118;
|
|
if (r120 >= 10) {
|
|
do {
|
|
r118 = r118 + 1;
|
|
r120 = r120 / 10;
|
|
r121 = r118;
|
|
} while (10 <= r120);
|
|
}
|
|
r16.length = 1;
|
|
const r123 = a1 - r121 - 1;
|
|
r16[0] = pow(10, (7 - r123 % 7) % 7);
|
|
a0.e = floor(-r123 / 7) || 0;
|
|
} else {
|
|
r16.length = 1;
|
|
a0.s = 0;
|
|
a0.e = 0;
|
|
r16[0] = 0;
|
|
}
|
|
return a0;
|
|
};
|
|
subtract = function subtract(a0, a1) {
|
|
"use strict";
|
|
let r29, r40, r44, r45, r48, r49, r66, r82, r91, r105, r111, r117, length2;
|
|
const constructor = a0.constructor;
|
|
const precision = constructor.precision;
|
|
if (a0.s && a1.s) {
|
|
const r14 = a0.d;
|
|
const { d: r35, e: r16 } = a1;
|
|
let r36 = a0.e;
|
|
const r38 = r14.slice();
|
|
const r19 = r36 - r16;
|
|
if (r19) {
|
|
const r47 = r19 < 0;
|
|
if (r47) {
|
|
r48 = -r19;
|
|
length2 = r35.length;
|
|
r36 = r16;
|
|
r49 = r38;
|
|
} else {
|
|
length2 = r38.length;
|
|
r48 = r19;
|
|
r49 = r35;
|
|
}
|
|
const r58 = Math.max(Math.ceil(precision / 7), length2) + 2;
|
|
if (r48 > r58) {
|
|
r49.length = 1;
|
|
r48 = r58;
|
|
}
|
|
r49.reverse();
|
|
const r62 = +r48;
|
|
let r63 = r62 - 1;
|
|
if (r62) {
|
|
do {
|
|
r49.push(0);
|
|
r66 = +r63;
|
|
r63 = r66 - 1;
|
|
} while (r66);
|
|
}
|
|
r49.reverse();
|
|
r40 = r47;
|
|
r44 = r48;
|
|
r45 = r36;
|
|
} else {
|
|
const length = r38.length;
|
|
let length3 = r35.length;
|
|
const r5 = length < length3;
|
|
if (r5) {
|
|
length3 = length;
|
|
}
|
|
const r6 = 0 < length3;
|
|
let r0 = 0;
|
|
r40 = r5;
|
|
if (r6) {
|
|
do {
|
|
const r18 = r38[r0];
|
|
const r41 = r35[r0];
|
|
const r1 = r0;
|
|
if (r18 != r41) {
|
|
r40 = r38[r1] < r35[r1];
|
|
break;
|
|
}
|
|
r0 = r1 + 1;
|
|
r40 = r5;
|
|
} while (r0 < length3);
|
|
}
|
|
r44 = 0;
|
|
r45 = r16;
|
|
}
|
|
let r69 = r35;
|
|
let r70 = r38;
|
|
if (r40) {
|
|
a1.s = -a1.s;
|
|
r69 = r38;
|
|
r70 = r35;
|
|
}
|
|
const length4 = r70.length;
|
|
let r75 = r69.length - length4;
|
|
let r77 = length4;
|
|
let r78 = r77;
|
|
while (r75 > 0) {
|
|
const r79 = +r77;
|
|
r77 = r79 + 1;
|
|
r70[r79] = 0;
|
|
r75 = r75 - 1;
|
|
r78 = r77;
|
|
}
|
|
let length5 = r69.length;
|
|
if (length5 > r44) {
|
|
do {
|
|
r82 = length5 - 1;
|
|
if (r70[r82] < r69[r82]) {
|
|
let r85 = r82;
|
|
if (r85) {
|
|
const r86 = r82 - 1;
|
|
const r87 = r70[r86];
|
|
let r88 = r86;
|
|
r85 = r88;
|
|
if (r87 === 0) {
|
|
do {
|
|
r70[r88] = 9999999;
|
|
const r89 = r88;
|
|
r85 = r89;
|
|
if (!r85) {
|
|
break;
|
|
}
|
|
const r90 = r89 - 1;
|
|
r91 = r70[r90];
|
|
r88 = r90;
|
|
r85 = r88;
|
|
} while (r91 === 0);
|
|
}
|
|
}
|
|
r70[r85] = r70[r85] - 1;
|
|
r70[r82] = r70[r82] + c3508_9;
|
|
}
|
|
r70[r82] = r70[r82] - r69[r82];
|
|
length5 = r82;
|
|
} while (r82 > r44);
|
|
}
|
|
let r100 = r78 - 1;
|
|
if (r70[r100] === 0) {
|
|
do {
|
|
r70.pop();
|
|
const r104 = r100 - 1;
|
|
r105 = r70[r104];
|
|
r100 = r104;
|
|
} while (r105 === 0);
|
|
}
|
|
const r106 = r70[0];
|
|
let r107 = r45;
|
|
let r108 = r107;
|
|
if (r106 === 0) {
|
|
do {
|
|
r107 = r107 - 1;
|
|
r70.shift();
|
|
r111 = r70[0];
|
|
r108 = r107;
|
|
} while (r111 === 0);
|
|
}
|
|
if (r70[0]) {
|
|
a1.d = r70;
|
|
a1.e = r108;
|
|
const r118 = env3508[2];
|
|
r117 = a1;
|
|
if (r118) {
|
|
round(a1, precision);
|
|
r117 = a1;
|
|
}
|
|
} else {
|
|
r117 = new constructor(0);
|
|
}
|
|
return r117;
|
|
}
|
|
if (a1.s) {
|
|
a1.s = -a1.s;
|
|
r29 = a1;
|
|
} else {
|
|
r29 = new constructor(a0);
|
|
}
|
|
if (env3508[2]) {
|
|
round(r29, precision);
|
|
}
|
|
return r29;
|
|
};
|
|
toString = function toString(a0, a1, a2) {
|
|
"use strict";
|
|
let r34, r39, r46, r56, r69, r82, r84, r103;
|
|
let r19 = 7 * a0.e;
|
|
let r21 = a0.d[0];
|
|
let r5 = r19;
|
|
if (r21 >= 10) {
|
|
do {
|
|
r19 = r19 + 1;
|
|
r21 = r21 / 10;
|
|
r5 = r19;
|
|
} while (10 <= r21);
|
|
}
|
|
const r14 = digitsToString(a0.d);
|
|
const length = r14.length;
|
|
if (a1) {
|
|
if (a2) {
|
|
const r83 = a2 - length;
|
|
if (r83 > 0) {
|
|
const r97 = r14.charAt(0) + "." + r14.slice(1);
|
|
const r98 = +r83;
|
|
let r99 = r98 - 1;
|
|
let r100 = "";
|
|
let r102 = "";
|
|
if (r98) {
|
|
do {
|
|
r100 = r100 + "0";
|
|
r103 = +r99;
|
|
r99 = r103 - 1;
|
|
r102 = r100;
|
|
} while (r103);
|
|
}
|
|
r84 = r97 + r102;
|
|
} else {
|
|
r84 = length > 1 ? r14.charAt(0) + "." + r14.slice(1) : r14;
|
|
}
|
|
} else {
|
|
r84 = length > 1 ? r14.charAt(0) + "." + r14.slice(1) : r14;
|
|
}
|
|
r34 = r84 + (r5 < 0 ? "e" : "e+") + r5;
|
|
} else if (r5 < 0) {
|
|
const r62 = -r5 - 1;
|
|
let r63 = r62 - 1;
|
|
let r66 = "";
|
|
let r67 = "";
|
|
if (r62) {
|
|
do {
|
|
r66 = r66 + "0";
|
|
const r68 = r63 - 1;
|
|
r69 = r63;
|
|
r63 = r68;
|
|
r67 = r66;
|
|
} while (r69);
|
|
}
|
|
const r74 = `0.${r67}${r14}`;
|
|
let r75 = void 0;
|
|
let r76 = a2;
|
|
if (a2) {
|
|
const r77 = a2 - length;
|
|
r76 = r77 > 0;
|
|
r75 = r77;
|
|
}
|
|
r34 = r74;
|
|
if (r76) {
|
|
const r78 = +r75;
|
|
let r79 = r78 - 1;
|
|
let r80 = "";
|
|
let r81 = "";
|
|
if (r78) {
|
|
do {
|
|
r80 = r80 + "0";
|
|
r82 = +r79;
|
|
r79 = r82 - 1;
|
|
r81 = r80;
|
|
} while (r82);
|
|
}
|
|
r34 = r74 + r81;
|
|
}
|
|
} else if (r5 >= length) {
|
|
const r41 = r5 + 1 - length;
|
|
let r0 = r41 - 1;
|
|
let r44 = "";
|
|
let r45 = "";
|
|
if (r41) {
|
|
do {
|
|
r44 = r44 + "0";
|
|
const r3 = r0 - 1;
|
|
r46 = r0;
|
|
r0 = r3;
|
|
r45 = r44;
|
|
} while (r46);
|
|
}
|
|
let r47 = a2;
|
|
let r48 = void 0;
|
|
if (a2) {
|
|
const r50 = a2 - r5 - 1;
|
|
r47 = r50 > 0;
|
|
r48 = r50;
|
|
}
|
|
const r51 = r14 + r45;
|
|
r34 = r51;
|
|
if (r47) {
|
|
const r52 = +r48;
|
|
let r53 = r52 - 1;
|
|
let r54 = "";
|
|
let r55 = "";
|
|
if (r52) {
|
|
do {
|
|
r54 = r54 + "0";
|
|
r56 = +r53;
|
|
r53 = r56 - 1;
|
|
r55 = r54;
|
|
} while (r56);
|
|
}
|
|
r34 = HermesInternal.concat.call(r51, ".", r55);
|
|
}
|
|
} else {
|
|
const r25 = r5 + 1;
|
|
const r16 = r25 < length ? r14.slice(0, r25) + "." + r14.slice(r25) : r14;
|
|
let r13 = a2;
|
|
let r32 = r25;
|
|
if (a2) {
|
|
const r33 = a2 - length;
|
|
r13 = r33 > 0;
|
|
r32 = r33;
|
|
}
|
|
r34 = r16;
|
|
if (r13) {
|
|
const r35 = r25 === length ? r16 + "." : r16;
|
|
const r36 = +r32;
|
|
let r18 = r36 - 1;
|
|
let r37 = "";
|
|
let r38 = "";
|
|
if (r36) {
|
|
do {
|
|
r37 = r37 + "0";
|
|
r39 = +r18;
|
|
r18 = r39 - 1;
|
|
r38 = r37;
|
|
} while (r39);
|
|
}
|
|
r34 = r35 + r38;
|
|
}
|
|
}
|
|
return a0.s < 0 ? "-" + r34 : r34;
|
|
};
|
|
config = function config(a0) {
|
|
"use strict";
|
|
let r2;
|
|
if (a0 && typeof a0 === "object") {
|
|
let r0 = 0;
|
|
const r12 = ["precision", 1, 1000000000, "rounding", 0, 8, "toExpNeg", -Infinity, 0, "toExpPos", 0, Infinity];
|
|
if (0 < r12.length) {
|
|
do {
|
|
L9: {
|
|
const r13 = r12[r0];
|
|
const r26 = a0[r13];
|
|
r2 = r0;
|
|
if (r26 !== void 0) {
|
|
if (floor(r26) === r26 && r26 >= r12[r2 + 1] && r26 <= r12[r2 + 2]) {
|
|
this[r13] = r26;
|
|
break L9;
|
|
}
|
|
throw Error(c3508_4 + r13 + ": " + r26);
|
|
}
|
|
}
|
|
r0 = r2 + 3;
|
|
} while (r0 < r12.length);
|
|
}
|
|
const LN10 = a0.LN10;
|
|
if (LN10 !== void 0) {
|
|
if (LN10 != Math.LN10) {
|
|
throw Error(c3508_4 + "LN10: " + LN10);
|
|
}
|
|
this.LN10 = new this(LN10);
|
|
}
|
|
return this;
|
|
}
|
|
throw Error("[DecimalError] Object expected");
|
|
};
|
|
const r9 = {
|
|
precision: 20,
|
|
rounding: 4,
|
|
toExpNeg: -7,
|
|
toExpPos: 21,
|
|
LN10: "2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"
|
|
};
|
|
env3508[1] = r9;
|
|
env3508[2] = true;
|
|
c3508_3 = "[DecimalError] ";
|
|
c3508_4 = "[DecimalError] Invalid argument: ";
|
|
c3508_5 = "[DecimalError] Exponent out of range: ";
|
|
const floor2 = Math.floor;
|
|
floor = floor2;
|
|
pow = Math.pow;
|
|
c3508_8 = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
|
|
c3508_9 = 10000000;
|
|
c3508_10 = floor2(1286742750677284.5);
|
|
const prototype = {};
|
|
c3508_11 = prototype;
|
|
const abs = function() {
|
|
"use strict";
|
|
const constructor = new this.constructor(this);
|
|
if (constructor.s) {
|
|
constructor.s = 1;
|
|
}
|
|
return constructor;
|
|
};
|
|
prototype.abs = abs;
|
|
prototype.absoluteValue = abs;
|
|
const cmp = function(a0) {
|
|
"use strict";
|
|
const constructor = new this.constructor(a0);
|
|
if (this.s !== constructor.s) {
|
|
return this.s || -constructor.s;
|
|
}
|
|
if (this.e !== constructor.e) {
|
|
return this.e > constructor.e ^ this.s < 0 ? 1 : -1;
|
|
}
|
|
const length = this.d.length;
|
|
const length2 = constructor.d.length;
|
|
let r12 = length2;
|
|
if (length < r12) {
|
|
r12 = length;
|
|
}
|
|
const r6 = 0 < r12;
|
|
let r0 = 0;
|
|
if (r6) {
|
|
do {
|
|
const r14 = this.d[r0];
|
|
const r27 = constructor.d[r0];
|
|
const r2 = r0;
|
|
if (r14 !== r27) {
|
|
return this.d[r2] > constructor.d[r2] ^ this.s < 0 ? 1 : -1;
|
|
}
|
|
r0 = r2 + 1;
|
|
} while (r0 < r12);
|
|
}
|
|
return length !== length2 ? length > length2 ^ this.s < 0 ? 1 : -1 : 0;
|
|
};
|
|
prototype.cmp = cmp;
|
|
prototype.comparedTo = cmp;
|
|
const dp = function() {
|
|
"use strict";
|
|
let r17;
|
|
const r2 = this.d.length - 1;
|
|
const r6 = 7 * (r2 - this.e);
|
|
let r13 = this.d[r2];
|
|
let r14 = r6;
|
|
if (r13) {
|
|
const r15 = r13 % 10;
|
|
let r16 = r6;
|
|
r14 = r16;
|
|
if (r15 === 0) {
|
|
do {
|
|
r16 = r16 - 1;
|
|
const r1 = r13 / 10;
|
|
r17 = r1 % 10;
|
|
r13 = r1;
|
|
r14 = r16;
|
|
} while (r17 === 0);
|
|
}
|
|
}
|
|
return r14 < 0 ? 0 : r14;
|
|
};
|
|
prototype.dp = dp;
|
|
prototype.decimalPlaces = dp;
|
|
const div = function(a0) {
|
|
"use strict";
|
|
return c3508_14(this, new this.constructor(a0));
|
|
};
|
|
prototype.div = div;
|
|
prototype.dividedBy = div;
|
|
const idiv = function(a0) {
|
|
"use strict";
|
|
const constructor = this.constructor;
|
|
const r17 = c3508_14(this, new constructor(a0), 0, 1);
|
|
round(r17, constructor.precision);
|
|
return r17;
|
|
};
|
|
prototype.idiv = idiv;
|
|
prototype.dividedToIntegerBy = idiv;
|
|
const eq = function(a0) {
|
|
"use strict";
|
|
return !this.cmp(a0);
|
|
};
|
|
prototype.eq = eq;
|
|
prototype.equals = eq;
|
|
prototype.exponent = function() {
|
|
"use strict";
|
|
let r0 = 7 * this.e;
|
|
let r9 = this.d[0];
|
|
let r10 = r0;
|
|
if (r9 >= 10) {
|
|
do {
|
|
r0 = r0 + 1;
|
|
r9 = r9 / 10;
|
|
r10 = r0;
|
|
} while (10 <= r9);
|
|
}
|
|
return r10;
|
|
};
|
|
const gt = function(a0) {
|
|
"use strict";
|
|
return this.cmp(a0) > 0;
|
|
};
|
|
prototype.gt = gt;
|
|
prototype.greaterThan = gt;
|
|
const gte = function(a0) {
|
|
"use strict";
|
|
return this.cmp(a0) >= 0;
|
|
};
|
|
prototype.gte = gte;
|
|
prototype.greaterThanOrEqualTo = gte;
|
|
const isint = function() {
|
|
"use strict";
|
|
return this.e > this.d.length - 2;
|
|
};
|
|
prototype.isint = isint;
|
|
prototype.isInteger = isint;
|
|
const isneg = function() {
|
|
"use strict";
|
|
return this.s < 0;
|
|
};
|
|
prototype.isneg = isneg;
|
|
prototype.isNegative = isneg;
|
|
const ispos = function() {
|
|
"use strict";
|
|
return this.s > 0;
|
|
};
|
|
prototype.ispos = ispos;
|
|
prototype.isPositive = ispos;
|
|
prototype.isZero = function() {
|
|
"use strict";
|
|
return this.s === 0;
|
|
};
|
|
const lt = function(a0) {
|
|
"use strict";
|
|
return this.cmp(a0) < 0;
|
|
};
|
|
prototype.lt = lt;
|
|
prototype.lessThan = lt;
|
|
const lte = function(a0) {
|
|
"use strict";
|
|
return this.cmp(a0) < 1;
|
|
};
|
|
prototype.lte = lte;
|
|
prototype.lessThanOrEqualTo = lte;
|
|
const log = function(a0) {
|
|
"use strict";
|
|
let r10, r11, r40, constructor, precision;
|
|
L5: {
|
|
constructor = this.constructor;
|
|
precision = constructor.precision;
|
|
r10 = precision + 5;
|
|
if (a0 !== void 0) {
|
|
const r17 = new constructor(a0);
|
|
if (!(r17.s < 1)) {
|
|
const r21 = r17.eq(c3508_0);
|
|
r11 = r17;
|
|
if (!r21) {
|
|
break L5;
|
|
}
|
|
}
|
|
throw Error("[DecimalError] NaN");
|
|
}
|
|
r11 = new constructor(10);
|
|
}
|
|
if (this.s < 1) {
|
|
throw Error(c3508_3 + (this.s ? "NaN" : "-Infinity"));
|
|
}
|
|
if (this.eq(c3508_0)) {
|
|
r40 = new constructor(0);
|
|
} else {
|
|
env3508[2] = false;
|
|
r40 = c3508_14(ln(this, r10), ln(r11, r10), r10);
|
|
env3508[2] = true;
|
|
round(r40, precision);
|
|
}
|
|
return r40;
|
|
};
|
|
prototype.log = log;
|
|
prototype.logarithm = log;
|
|
const sub = function(a0) {
|
|
"use strict";
|
|
let r15;
|
|
const constructor = new this.constructor(a0);
|
|
if (this.s == constructor.s) {
|
|
r15 = subtract(this, constructor);
|
|
} else {
|
|
constructor.s = -constructor.s;
|
|
r15 = add(this, constructor);
|
|
}
|
|
return r15;
|
|
};
|
|
prototype.sub = sub;
|
|
prototype.minus = sub;
|
|
const mod = function(a0) {
|
|
"use strict";
|
|
let r26;
|
|
const constructor = this.constructor;
|
|
const precision = constructor.precision;
|
|
const r8 = new constructor(a0);
|
|
if (r8.s) {
|
|
if (this.s) {
|
|
env3508[2] = false;
|
|
const r35 = c3508_14(this, r8, 0, 1).times(r8);
|
|
env3508[2] = true;
|
|
r26 = this.minus(r35);
|
|
} else {
|
|
r26 = new constructor(this);
|
|
round(r26, precision);
|
|
}
|
|
return r26;
|
|
}
|
|
throw Error("[DecimalError] NaN");
|
|
};
|
|
prototype.mod = mod;
|
|
prototype.modulo = mod;
|
|
const exp2 = function() {
|
|
"use strict";
|
|
return exp(this);
|
|
};
|
|
prototype.exp = exp2;
|
|
prototype.naturalExponential = exp2;
|
|
const ln2 = function() {
|
|
"use strict";
|
|
return ln(this);
|
|
};
|
|
prototype.ln = ln2;
|
|
prototype.naturalLogarithm = ln2;
|
|
const neg = function() {
|
|
"use strict";
|
|
const constructor = new this.constructor(this);
|
|
constructor.s = -constructor.s || 0;
|
|
return constructor;
|
|
};
|
|
prototype.neg = neg;
|
|
prototype.negated = neg;
|
|
const add2 = function(a0) {
|
|
"use strict";
|
|
let r15;
|
|
const constructor = new this.constructor(a0);
|
|
if (this.s == constructor.s) {
|
|
r15 = add(this, constructor);
|
|
} else {
|
|
constructor.s = -constructor.s;
|
|
r15 = subtract(this, constructor);
|
|
}
|
|
return r15;
|
|
};
|
|
prototype.add = add2;
|
|
prototype.plus = add2;
|
|
const sd = function(a0) {
|
|
"use strict";
|
|
let r29;
|
|
if (a0 !== void 0 && a0 !== !!a0 && a0 !== 1 && a0 !== 0) {
|
|
throw Error(c3508_4 + a0);
|
|
}
|
|
let r17 = 7 * this.e;
|
|
let r19 = this.d[0];
|
|
let r6 = r17;
|
|
if (r19 >= 10) {
|
|
do {
|
|
r17 = r17 + 1;
|
|
r19 = r19 / 10;
|
|
r6 = r17;
|
|
} while (10 <= r19);
|
|
}
|
|
const r22 = this.d.length - 1;
|
|
const r7 = 7 * r22 + 1;
|
|
let r25 = this.d[r22];
|
|
let r26 = r7;
|
|
if (r25) {
|
|
const r27 = r25 % 10;
|
|
let r1 = r7;
|
|
let r28 = r1;
|
|
if (r27 === 0) {
|
|
do {
|
|
r1 = r1 - 1;
|
|
const r4 = r25 / 10;
|
|
r29 = r4 % 10;
|
|
r25 = r4;
|
|
r28 = r1;
|
|
} while (r29 === 0);
|
|
}
|
|
let r31 = this.d[0];
|
|
let r32 = r28;
|
|
r26 = r32;
|
|
if (r31 >= 10) {
|
|
do {
|
|
r32 = r32 + 1;
|
|
r31 = r31 / 10;
|
|
r26 = r32;
|
|
} while (10 <= r31);
|
|
}
|
|
}
|
|
let r33 = r26;
|
|
if (a0) {
|
|
const r34 = r6 + 1;
|
|
r33 = r26;
|
|
if (r33 < r34) {
|
|
r33 = r34;
|
|
}
|
|
}
|
|
return r33;
|
|
};
|
|
prototype.sd = sd;
|
|
prototype.precision = sd;
|
|
const sqrt = function() {
|
|
"use strict";
|
|
let r18, r66, r95;
|
|
const constructor = this.constructor;
|
|
if (this.s < 1) {
|
|
if (this.s) {
|
|
throw Error("[DecimalError] NaN");
|
|
}
|
|
return new constructor(0);
|
|
}
|
|
let r29 = 7 * this.e;
|
|
let r31 = this.d[0];
|
|
let r3 = r29;
|
|
if (r31 >= 10) {
|
|
do {
|
|
r29 = r29 + 1;
|
|
r31 = r31 / 10;
|
|
r3 = r29;
|
|
} while (10 <= r31);
|
|
}
|
|
env3508[2] = false;
|
|
const r34 = Math.sqrt(+this);
|
|
if (r34 != 0 && r34 != Infinity) {
|
|
r18 = new constructor(r34.toString());
|
|
} else {
|
|
const r15 = digitsToString(this.d);
|
|
const r49 = Math.sqrt((r15.length + r3) % 2 === 0 ? r15 + "0" : r15);
|
|
const r54 = floor((r3 + 1) / 2);
|
|
let r55 = r3 < 0;
|
|
if (!(r3 < 0)) {
|
|
r55 = r3 % 2;
|
|
}
|
|
const r56 = r54 - r55;
|
|
if (r49 == Infinity) {
|
|
r66 = "1e" + r56;
|
|
} else {
|
|
const r59 = r49.toExponential();
|
|
r66 = r59.slice(0, r59.indexOf("e") + 1) + r56;
|
|
}
|
|
r18 = new constructor(r66);
|
|
}
|
|
const precision = constructor.precision;
|
|
const r17 = precision + 3;
|
|
let r78 = r17;
|
|
while (true) {
|
|
const r83 = r18.plus(c3508_14(this, r18, r78 + 2)).times(0.5);
|
|
const r87 = digitsToString(r18.d).slice(0, r78);
|
|
const r23 = digitsToString(r83.d);
|
|
const r90 = r23.slice(0, r78);
|
|
const r91 = r78;
|
|
const r22 = r18;
|
|
r78 = r91;
|
|
r18 = r83;
|
|
if (r87 === r90) {
|
|
L22: {
|
|
const r94 = r23.slice(r91 - 3, r91 + 1);
|
|
if (r17 == r91 && r94 == "4999") {
|
|
round(r22, precision + 1, 0);
|
|
const r102 = r22.times(r22).eq(this);
|
|
r95 = r22;
|
|
if (r102) {
|
|
break L22;
|
|
}
|
|
} else {
|
|
r95 = r83;
|
|
if (r94 != "9999") {
|
|
break L22;
|
|
}
|
|
}
|
|
r78 = r91 + 4;
|
|
r18 = r83;
|
|
continue;
|
|
}
|
|
env3508[2] = true;
|
|
round(r95, precision);
|
|
return r95;
|
|
}
|
|
}
|
|
};
|
|
prototype.sqrt = sqrt;
|
|
prototype.squareRoot = sqrt;
|
|
const mul = function(a0) {
|
|
"use strict";
|
|
let r48, r70, r73;
|
|
const constructor = this.constructor;
|
|
const r18 = this.d;
|
|
const r27 = new constructor(a0);
|
|
const r12 = r27.d;
|
|
if (this.s && r27.s) {
|
|
r27.s = r27.s * this.s;
|
|
const r39 = this.e + r27.e;
|
|
const length = r18.length;
|
|
const length2 = r12.length;
|
|
let r17 = r12;
|
|
let r16 = r18;
|
|
let r14 = length2;
|
|
let r15 = length;
|
|
if (r15 < length2) {
|
|
r17 = r18;
|
|
r16 = r12;
|
|
r14 = length;
|
|
r15 = length2;
|
|
}
|
|
const r42 = [];
|
|
const r43 = r15 + r14;
|
|
const r44 = +r43;
|
|
let r45 = r44 - 1;
|
|
if (r44) {
|
|
do {
|
|
r42.push(0);
|
|
r48 = +r45;
|
|
r45 = r48 - 1;
|
|
} while (r48);
|
|
}
|
|
let r50 = r14 - 1;
|
|
let r6 = void 0;
|
|
while (r50 >= 0) {
|
|
let r20 = r15 + r50;
|
|
const r51 = r50;
|
|
let r1 = 0;
|
|
let r2 = 0;
|
|
let r19 = r20;
|
|
while (r19 > r51) {
|
|
const r55 = r42[r20] + r17[r51] * r16[r20 - r51 - 1] + r1;
|
|
const r56 = +r20;
|
|
r20 = r56 - 1;
|
|
r42[r56] = r55 % c3508_9 | 0;
|
|
r1 = r55 / c3508_9 | 0;
|
|
r2 = r1;
|
|
r19 = r20;
|
|
}
|
|
r42[r19] = (r42[r19] + r2) % c3508_9 | 0;
|
|
r50 = r51 - 1;
|
|
r6 = r2;
|
|
}
|
|
let r65 = r43 - 1;
|
|
if (!r42[r65]) {
|
|
do {
|
|
r42.pop();
|
|
const r69 = r65 - 1;
|
|
r70 = r42[r69];
|
|
r65 = r69;
|
|
} while (!r70);
|
|
}
|
|
if (r6) {
|
|
r73 = r39 + 1;
|
|
} else {
|
|
r42.shift();
|
|
r73 = r39;
|
|
}
|
|
r27.d = r42;
|
|
r27.e = r73;
|
|
if (env3508[2]) {
|
|
round(r27, constructor.precision);
|
|
}
|
|
return r27;
|
|
}
|
|
return new constructor(0);
|
|
};
|
|
prototype.mul = mul;
|
|
prototype.times = mul;
|
|
const todp = function(a0, a1) {
|
|
"use strict";
|
|
let r12, r20;
|
|
L14: {
|
|
const constructor = this.constructor;
|
|
r20 = new constructor(this);
|
|
if (a0 !== void 0) {
|
|
if (a0 === ~~a0 && !(a0 < 0) && !(a0 > 1000000000)) {
|
|
L10: {
|
|
if (a1 !== void 0) {
|
|
if (a1 === ~~a1 && !(a1 < 0)) {
|
|
r12 = a1;
|
|
if (!(a1 > 8)) {
|
|
break L10;
|
|
}
|
|
}
|
|
throw Error(c3508_4 + a1);
|
|
}
|
|
r12 = constructor.rounding;
|
|
}
|
|
let r0 = 7 * r20.e;
|
|
let r34 = r20.d[0];
|
|
let r36 = r0;
|
|
if (r34 >= 10) {
|
|
do {
|
|
r0 = r0 + 1;
|
|
r34 = r34 / 10;
|
|
r36 = r0;
|
|
} while (10 <= r34);
|
|
}
|
|
round(r20, a0 + r36 + 1, r12);
|
|
break L14;
|
|
}
|
|
throw Error(c3508_4 + a0);
|
|
}
|
|
}
|
|
return r20;
|
|
};
|
|
prototype.todp = todp;
|
|
prototype.toDecimalPlaces = todp;
|
|
prototype.toExponential = function(a0, a1) {
|
|
"use strict";
|
|
let r11, r33;
|
|
L13: {
|
|
const constructor = this.constructor;
|
|
if (a0 !== void 0) {
|
|
if (a0 === ~~a0 && !(a0 < 0) && !(a0 > 1000000000)) {
|
|
L10: {
|
|
if (a1 !== void 0) {
|
|
if (a1 === ~~a1 && !(a1 < 0)) {
|
|
r11 = a1;
|
|
if (!(a1 > 8)) {
|
|
break L10;
|
|
}
|
|
}
|
|
throw Error(c3508_4 + a1);
|
|
}
|
|
r11 = constructor.rounding;
|
|
}
|
|
const r28 = new constructor(this);
|
|
round(r28, a0 + 1, r11);
|
|
r33 = toString(r28, true, a0 + 1);
|
|
break L13;
|
|
}
|
|
throw Error(c3508_4 + a0);
|
|
}
|
|
r33 = toString(this, true);
|
|
}
|
|
return r33;
|
|
};
|
|
prototype.toFixed = function(a0, a1) {
|
|
"use strict";
|
|
let r17, r54;
|
|
L20: {
|
|
const constructor = this.constructor;
|
|
if (a0 !== void 0) {
|
|
if (a0 === ~~a0 && !(a0 < 0) && !(a0 > 1000000000)) {
|
|
L10: {
|
|
if (a1 !== void 0) {
|
|
if (a1 === ~~a1 && !(a1 < 0)) {
|
|
r17 = a1;
|
|
if (!(a1 > 8)) {
|
|
break L10;
|
|
}
|
|
}
|
|
throw Error(c3508_4 + a1);
|
|
}
|
|
r17 = constructor.rounding;
|
|
}
|
|
const r34 = new constructor(this);
|
|
let r1 = 7 * this.e;
|
|
let r36 = this.d[0];
|
|
let r0 = r1;
|
|
if (r36 >= 10) {
|
|
do {
|
|
r1 = r1 + 1;
|
|
r36 = r36 / 10;
|
|
r0 = r1;
|
|
} while (10 <= r36);
|
|
}
|
|
round(r34, a0 + r0 + 1, r17);
|
|
const r43 = r34.abs();
|
|
let r45 = 7 * r34.e;
|
|
let r47 = r34.d[0];
|
|
let r48 = r45;
|
|
if (r47 >= 10) {
|
|
do {
|
|
r45 = r45 + 1;
|
|
r47 = r47 / 10;
|
|
r48 = r45;
|
|
} while (10 <= r47);
|
|
}
|
|
const r51 = toString(r43, false, a0 + r48 + 1);
|
|
const r53 = this.isneg();
|
|
r54 = r51;
|
|
if (!r53) {
|
|
break L20;
|
|
}
|
|
const isZero = this.isZero();
|
|
r54 = r51;
|
|
if (isZero) {
|
|
break L20;
|
|
}
|
|
r54 = "-" + r51;
|
|
break L20;
|
|
}
|
|
throw Error(c3508_4 + a0);
|
|
}
|
|
r54 = toString(this);
|
|
}
|
|
return r54;
|
|
};
|
|
const toint = function() {
|
|
"use strict";
|
|
const constructor = this.constructor;
|
|
const r17 = new constructor(this);
|
|
let r0 = 7 * this.e;
|
|
let r19 = this.d[0];
|
|
let r20 = r0;
|
|
if (r19 >= 10) {
|
|
do {
|
|
r0 = r0 + 1;
|
|
r19 = r19 / 10;
|
|
r20 = r0;
|
|
} while (10 <= r19);
|
|
}
|
|
round(r17, r20 + 1, constructor.rounding);
|
|
return r17;
|
|
};
|
|
prototype.toint = toint;
|
|
prototype.toInteger = toint;
|
|
prototype.toNumber = function() {
|
|
"use strict";
|
|
return +this;
|
|
};
|
|
const pow2 = function(a0) {
|
|
"use strict";
|
|
let r115;
|
|
const constructor = this.constructor;
|
|
const r26 = new constructor(a0);
|
|
const r1 = +r26;
|
|
if (r26.s) {
|
|
const r36 = new constructor(this);
|
|
if (r36.s) {
|
|
if (r36.eq(c3508_0)) {
|
|
return r36;
|
|
}
|
|
const precision = constructor.precision;
|
|
if (r26.eq(c3508_0)) {
|
|
round(r36, precision);
|
|
return r36;
|
|
}
|
|
const r16 = r26.e;
|
|
let r2 = r26.d.length - 1;
|
|
const r50 = r16 >= r2;
|
|
const r51 = r36.s;
|
|
if (r50) {
|
|
let r0 = r1;
|
|
if (r0 < 0) {
|
|
r0 = -r1;
|
|
}
|
|
r2 = r0;
|
|
if (r2 <= 9007199254740991) {
|
|
const r80 = new constructor(c3508_0);
|
|
const length4 = Math.ceil(precision / 7 + 4);
|
|
env3508[2] = false;
|
|
const r91 = r0 % 2;
|
|
let r92 = r80;
|
|
if (r91) {
|
|
const r94 = r80.times(r36);
|
|
const r95 = r94.d;
|
|
const length3 = r95.length;
|
|
r92 = r94;
|
|
if (length3 > length4) {
|
|
r95.length = length4;
|
|
r92 = r94;
|
|
}
|
|
}
|
|
let r100 = floor(r0 / 2);
|
|
let r101 = r92;
|
|
let r102 = r36;
|
|
let r103 = r101;
|
|
while (r100 !== 0) {
|
|
const r19 = r102.times(r102);
|
|
const r104 = r19.d;
|
|
const length = r104.length;
|
|
const r21 = r101;
|
|
const r20 = r100;
|
|
if (length > length4) {
|
|
r104.length = length4;
|
|
}
|
|
const r105 = r20 % 2;
|
|
let r106 = r21;
|
|
if (r105) {
|
|
const r108 = r21.times(r19);
|
|
const r109 = r108.d;
|
|
const length2 = r109.length;
|
|
r106 = r108;
|
|
if (length2 > length4) {
|
|
r109.length = length4;
|
|
r106 = r108;
|
|
}
|
|
}
|
|
r100 = floor(r20 / 2);
|
|
r101 = r106;
|
|
r102 = r19;
|
|
r103 = r101;
|
|
}
|
|
env3508[2] = true;
|
|
if (r26.s < 0) {
|
|
r115 = new constructor(c3508_0).div(r103);
|
|
} else {
|
|
round(r103, precision);
|
|
r115 = r103;
|
|
}
|
|
return r115;
|
|
}
|
|
} else if (r51 < 0) {
|
|
throw Error("[DecimalError] NaN");
|
|
}
|
|
const r58 = r51 < 0 ? 1 & r26.d[Math.max(r16, r2)] ? -1 : 1 : 1;
|
|
r36.s = 1;
|
|
env3508[2] = false;
|
|
const r72 = r26.times(ln(r36, precision + 12));
|
|
env3508[2] = true;
|
|
const r75 = exp(r72);
|
|
r75.s = r58;
|
|
return r75;
|
|
}
|
|
if (r26.s < 1) {
|
|
throw Error("[DecimalError] Infinity");
|
|
}
|
|
return r36;
|
|
}
|
|
return new constructor(c3508_0);
|
|
};
|
|
prototype.pow = pow2;
|
|
prototype.toPower = pow2;
|
|
prototype.toPrecision = function(a0, a1) {
|
|
"use strict";
|
|
let r16, r43;
|
|
L21: {
|
|
const constructor = this.constructor;
|
|
if (a0 !== void 0) {
|
|
if (a0 === ~~a0 && !(a0 < 1) && !(a0 > 1000000000)) {
|
|
L10: {
|
|
if (a1 !== void 0) {
|
|
if (a1 === ~~a1 && !(a1 < 0)) {
|
|
r16 = a1;
|
|
if (!(a1 > 8)) {
|
|
break L10;
|
|
}
|
|
}
|
|
throw Error(c3508_4 + a1);
|
|
}
|
|
r16 = constructor.rounding;
|
|
}
|
|
const r34 = new constructor(this);
|
|
round(r34, a0, r16);
|
|
let r0 = 7 * r34.e;
|
|
let r39 = r34.d[0];
|
|
let r40 = r0;
|
|
if (r39 >= 10) {
|
|
do {
|
|
r0 = r0 + 1;
|
|
r39 = r39 / 10;
|
|
r40 = r0;
|
|
} while (10 <= r39);
|
|
}
|
|
r43 = toString(r34, a0 <= r40 || r40 <= constructor.toExpNeg, a0);
|
|
break L21;
|
|
}
|
|
throw Error(c3508_4 + a0);
|
|
}
|
|
let r52 = 7 * this.e;
|
|
let r54 = this.d[0];
|
|
let r57 = r52;
|
|
if (r54 >= 10) {
|
|
do {
|
|
r52 = r52 + 1;
|
|
r54 = r54 / 10;
|
|
r57 = r52;
|
|
} while (10 <= r54);
|
|
}
|
|
r43 = toString(this, r57 <= constructor.toExpNeg || r57 >= constructor.toExpPos);
|
|
}
|
|
return r43;
|
|
};
|
|
const tosd = function(a0, a1) {
|
|
"use strict";
|
|
let r5, constructor, rounding;
|
|
L12: {
|
|
constructor = this.constructor;
|
|
if (a0 !== void 0) {
|
|
if (a0 === ~~a0 && !(a0 < 1) && !(a0 > 1000000000)) {
|
|
if (a1 === void 0) {
|
|
rounding = constructor.rounding;
|
|
r5 = a0;
|
|
break L12;
|
|
}
|
|
if (a1 === ~~a1 && !(a1 < 0)) {
|
|
r5 = a0;
|
|
rounding = a1;
|
|
if (!(a1 > 8)) {
|
|
break L12;
|
|
}
|
|
}
|
|
throw Error(c3508_4 + a1);
|
|
}
|
|
throw Error(c3508_4 + a0);
|
|
}
|
|
r5 = constructor.precision;
|
|
rounding = constructor.rounding;
|
|
}
|
|
const r33 = new constructor(this);
|
|
round(r33, r5, rounding);
|
|
return r33;
|
|
};
|
|
prototype.tosd = tosd;
|
|
prototype.toSignificantDigits = tosd;
|
|
const toJSON = function() {
|
|
"use strict";
|
|
let r0 = 7 * this.e;
|
|
let r13 = this.d[0];
|
|
let r14 = r0;
|
|
if (r13 >= 10) {
|
|
do {
|
|
r0 = r0 + 1;
|
|
r13 = r13 / 10;
|
|
r14 = r0;
|
|
} while (10 <= r13);
|
|
}
|
|
const constructor = this.constructor;
|
|
return toString(this, r14 <= constructor.toExpNeg || r14 >= constructor.toExpPos);
|
|
};
|
|
prototype.toJSON = toJSON;
|
|
prototype.val = toJSON;
|
|
prototype.valueOf = toJSON;
|
|
prototype.toString = toJSON;
|
|
c3508_14 = function(a0, a1, a2, a3) {
|
|
"use strict";
|
|
let r8, r9, r49, r78, r79, r84, r120, r136, r159, r164, r172, r173, r174, r191, r198, r201, r223, r250, r260, r265, r290, r300, r301, r313, length11, length14, length6;
|
|
const constructor = a0.constructor;
|
|
const r7 = a0.s == a1.s ? 1 : -1;
|
|
const r31 = a0.d;
|
|
const r28 = a1.d;
|
|
if (a0.s) {
|
|
if (a1.s) {
|
|
const r27 = a0.e - a1.e;
|
|
let length2 = r28.length;
|
|
const length = r31.length;
|
|
const r74 = new constructor(r7);
|
|
const r29 = [];
|
|
r74.d = r29;
|
|
const r76 = r28[0] == (r31[0] || 0);
|
|
let r15 = 0;
|
|
let r18 = 0;
|
|
if (r76) {
|
|
do {
|
|
const r11 = r15 + 1;
|
|
r78 = r28[r11];
|
|
r79 = r31[r11] || 0;
|
|
r15 = r11;
|
|
r18 = r15;
|
|
} while (r78 == r79);
|
|
}
|
|
const r81 = r28[r18] > (r31[r18] || 0) ? r27 - 1 : r27;
|
|
let r82 = a2;
|
|
if (a2 == null) {
|
|
r82 = constructor.precision;
|
|
r84 = r82;
|
|
} else {
|
|
r84 = a2;
|
|
if (a3) {
|
|
let r87 = 7 * a0.e;
|
|
let r89 = a0.d[0];
|
|
let r90 = r87;
|
|
if (r89 >= 10) {
|
|
do {
|
|
r87 = r87 + 1;
|
|
r89 = r89 / 10;
|
|
r90 = r87;
|
|
} while (10 <= r89);
|
|
}
|
|
let r92 = 7 * a1.e;
|
|
let r94 = a1.d[0];
|
|
let r95 = r92;
|
|
if (r94 >= 10) {
|
|
do {
|
|
r92 = r92 + 1;
|
|
r94 = r94 / 10;
|
|
r95 = r92;
|
|
} while (10 <= r94);
|
|
}
|
|
r84 = a2 + (r90 - r95) + 1;
|
|
}
|
|
}
|
|
if (r84 < 0) {
|
|
return new constructor(0);
|
|
}
|
|
const r103 = r84 / 7 + 2 | 0;
|
|
if (length2 == 1) {
|
|
const r306 = r28[0];
|
|
if (0 < length) {
|
|
const r307 = r103 + 1;
|
|
let r308 = r307 - 1;
|
|
let r309 = 0;
|
|
let r310 = 0;
|
|
if (r307) {
|
|
do {
|
|
let r312 = r31[r310];
|
|
r313 = r308;
|
|
const r314 = r309;
|
|
const r315 = r310;
|
|
if (!r312) {
|
|
r312 = 0;
|
|
}
|
|
const r317 = r314 * c3508_9 + r312;
|
|
r29[r315] = r317 / r306 | 0;
|
|
const r321 = r317 % r306 | 0;
|
|
const r322 = r315 + 1;
|
|
if (!(r322 < length) && !r321) {
|
|
break;
|
|
}
|
|
r308 = r313 - 1;
|
|
r309 = r321;
|
|
r310 = r322;
|
|
} while (r313);
|
|
}
|
|
}
|
|
} else {
|
|
const r16 = c3508_9 / (r28[0] + 1) | 0;
|
|
let r40 = r28;
|
|
let r108 = r31;
|
|
let r39 = length;
|
|
if (1 < r16) {
|
|
const length3 = r28.length;
|
|
const r37 = r28.slice();
|
|
const r111 = +length3;
|
|
let r112 = r111 - 1;
|
|
let r113 = 0;
|
|
let r114 = 0;
|
|
if (r111) {
|
|
do {
|
|
const r116 = r37[r112] * r16 + r113;
|
|
r37[r112] = r116 % c3508_9 | 0;
|
|
r113 = r116 / c3508_9 | 0;
|
|
r120 = +r112;
|
|
r112 = r120 - 1;
|
|
r114 = r113;
|
|
} while (r120);
|
|
}
|
|
if (r114) {
|
|
r37.unshift(r114);
|
|
}
|
|
const length4 = r31.length;
|
|
const r36 = r31.slice();
|
|
const r125 = +length4;
|
|
let r126 = r125 - 1;
|
|
let r127 = 0;
|
|
let r128 = 0;
|
|
if (r125) {
|
|
do {
|
|
const r131 = r36[r126] * r16 + r127;
|
|
r36[r126] = r131 % c3508_9 | 0;
|
|
r127 = r131 / c3508_9 | 0;
|
|
r136 = +r126;
|
|
r126 = r136 - 1;
|
|
r128 = r127;
|
|
} while (r136);
|
|
}
|
|
if (r128) {
|
|
r36.unshift(r128);
|
|
}
|
|
length2 = r37.length;
|
|
r39 = r36.length;
|
|
r40 = r37;
|
|
r108 = r36;
|
|
}
|
|
const r41 = r108.slice(0, length2);
|
|
const length5 = r41.length;
|
|
const r38 = r108;
|
|
let r142 = length5;
|
|
let r42 = r142;
|
|
while (r42 < length2) {
|
|
const r143 = +r142;
|
|
r142 = r143 + 1;
|
|
r41[r143] = 0;
|
|
r42 = r142;
|
|
}
|
|
const r145 = r40.slice();
|
|
r145.unshift(0);
|
|
const r43 = r40[0];
|
|
const r19 = r40[1] >= 5000000;
|
|
let r152 = r43;
|
|
let r153 = length2;
|
|
let r154 = r103;
|
|
let r155 = r42;
|
|
let r156 = r41;
|
|
let r157 = 0;
|
|
if (r19) {
|
|
r152 = r43 + 1;
|
|
r153 = length2;
|
|
r154 = r103;
|
|
r155 = r42;
|
|
r156 = r41;
|
|
r157 = 0;
|
|
}
|
|
do {
|
|
const r44 = r152;
|
|
const r158 = r153;
|
|
r159 = r154;
|
|
let r160 = r155;
|
|
const r161 = r156;
|
|
const r162 = r157;
|
|
if (length2 != r160) {
|
|
r8 = length2 > r160 ? 1 : -1;
|
|
} else {
|
|
const r163 = 0 < length2;
|
|
let r6 = 0;
|
|
r8 = 0;
|
|
if (r163) {
|
|
do {
|
|
const r46 = r40[r6];
|
|
const r45 = r161[r6];
|
|
const r10 = r6;
|
|
if (r46 != r45) {
|
|
r8 = r40[r10] > r161[r10] ? 1 : -1;
|
|
break;
|
|
}
|
|
const r3 = r10 + 1;
|
|
r164 = r3 < length2;
|
|
r6 = r3;
|
|
r8 = 0;
|
|
} while (r164);
|
|
}
|
|
}
|
|
if (r8 < 0) {
|
|
const r48 = r161[0];
|
|
let r179 = (length2 != r160 ? r48 * c3508_9 + (r161[1] || 0) : r48) / r44 | 0;
|
|
if (1 < r179) {
|
|
if (r179 >= c3508_9) {
|
|
r179 = 9999999;
|
|
}
|
|
const length7 = r40.length;
|
|
const r50 = r40.slice();
|
|
const r184 = +length7;
|
|
let r185 = r184 - 1;
|
|
let r0 = 0;
|
|
let r2 = 0;
|
|
if (r184) {
|
|
do {
|
|
const r187 = r50[r185] * r179 + r0;
|
|
r50[r185] = r187 % c3508_9 | 0;
|
|
r0 = r187 / c3508_9 | 0;
|
|
r191 = +r185;
|
|
r185 = r191 - 1;
|
|
r2 = r0;
|
|
} while (r191);
|
|
}
|
|
if (r2) {
|
|
r50.unshift(r2);
|
|
}
|
|
const length8 = r50.length;
|
|
const length9 = r161.length;
|
|
if (length8 != length9) {
|
|
r198 = length8 > length9 ? 1 : -1;
|
|
} else {
|
|
const r196 = 0 < length8;
|
|
let r197 = 0;
|
|
r198 = 0;
|
|
if (r196) {
|
|
do {
|
|
const r52 = r50[r197];
|
|
const r51 = r161[r197];
|
|
const r199 = r197;
|
|
if (r52 != r51) {
|
|
r198 = r50[r199] > r161[r199] ? 1 : -1;
|
|
break;
|
|
}
|
|
const r200 = r199 + 1;
|
|
r201 = r200 < length8;
|
|
r197 = r200;
|
|
r198 = 0;
|
|
} while (r201);
|
|
}
|
|
}
|
|
r160 = length9;
|
|
r49 = r50;
|
|
r9 = r179;
|
|
r8 = r198;
|
|
if (r198 === 1) {
|
|
const r208 = length2 < length8 ? r145 : r40;
|
|
const r209 = +length8;
|
|
let r210 = r209 - 1;
|
|
let r211 = 0;
|
|
if (r209) {
|
|
do {
|
|
r50[r210] = r50[r210] - r211;
|
|
const r215 = r50[r210] < r208[r210];
|
|
const r216 = r210;
|
|
const r217 = r215 ? 1 : 0;
|
|
r50[r216] = r217 * c3508_9 + r50[r216] - r208[r216];
|
|
r223 = +r216;
|
|
r210 = r223 - 1;
|
|
r211 = r217;
|
|
} while (r223);
|
|
}
|
|
const r224 = r179 - 1;
|
|
const r225 = r50[0];
|
|
r160 = length9;
|
|
r49 = r50;
|
|
r9 = r224;
|
|
r8 = r198;
|
|
if (!r225) {
|
|
const length10 = r50.length;
|
|
r160 = length9;
|
|
r49 = r50;
|
|
r9 = r224;
|
|
r8 = r198;
|
|
if (length10 > 1) {
|
|
do {
|
|
r50.shift();
|
|
const r229 = r50[0];
|
|
r160 = length9;
|
|
r49 = r50;
|
|
r9 = r224;
|
|
r8 = r198;
|
|
if (r229) {
|
|
break;
|
|
}
|
|
length11 = r50.length;
|
|
r160 = length9;
|
|
r49 = r50;
|
|
r9 = r224;
|
|
r8 = r198;
|
|
} while (length11 > 1);
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
r9 = r179;
|
|
if (r179 === 0) {
|
|
r9 = 1;
|
|
r8 = 1;
|
|
}
|
|
r49 = r40.slice();
|
|
}
|
|
if (r49.length < r160) {
|
|
r49.unshift(0);
|
|
}
|
|
const r234 = +r160;
|
|
let r235 = r234 - 1;
|
|
let r236 = 0;
|
|
if (r234) {
|
|
do {
|
|
r161[r235] = r161[r235] - r236;
|
|
const r241 = r161[r235] < r49[r235];
|
|
const r242 = r235;
|
|
const r243 = r241 ? 1 : 0;
|
|
r161[r242] = r243 * c3508_9 + r161[r242] - r49[r242];
|
|
r250 = +r242;
|
|
r235 = r250 - 1;
|
|
r236 = r243;
|
|
} while (r250);
|
|
}
|
|
if (!r161[0]) {
|
|
while (r161.length > 1) {
|
|
r161.shift();
|
|
if (r161[0]) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
let r257 = r8 === -1;
|
|
if (r8 === -1) {
|
|
const length12 = r161.length;
|
|
if (length2 != length12) {
|
|
r260 = length2 > length12 ? 1 : -1;
|
|
} else {
|
|
const r20 = 0 < length2;
|
|
let r259 = 0;
|
|
r260 = 0;
|
|
if (r20) {
|
|
do {
|
|
const r261 = r40[r259];
|
|
const r262 = r161[r259];
|
|
const r263 = r259;
|
|
if (r261 != r262) {
|
|
r260 = r40[r263] > r161[r263] ? 1 : -1;
|
|
break;
|
|
}
|
|
const r264 = r263 + 1;
|
|
r265 = r264 < length2;
|
|
r259 = r264;
|
|
r260 = 0;
|
|
} while (r265);
|
|
}
|
|
}
|
|
r257 = r260 < 1;
|
|
r8 = r260;
|
|
r160 = length12;
|
|
}
|
|
let r272 = r9;
|
|
if (r257) {
|
|
const r273 = length2 < r160 ? r145 : r40;
|
|
const r274 = +r160;
|
|
let r275 = r274 - 1;
|
|
let r276 = 0;
|
|
if (r274) {
|
|
do {
|
|
r161[r275] = r161[r275] - r276;
|
|
const r281 = r161[r275] < r273[r275];
|
|
const r282 = r275;
|
|
const r283 = r281 ? 1 : 0;
|
|
r161[r282] = r283 * c3508_9 + r161[r282] - r273[r282];
|
|
r290 = +r282;
|
|
r275 = r290 - 1;
|
|
r276 = r283;
|
|
} while (r290);
|
|
}
|
|
const r291 = r9 + 1;
|
|
const r292 = r161[0];
|
|
r272 = r291;
|
|
if (!r292) {
|
|
const length13 = r161.length;
|
|
r272 = r291;
|
|
if (length13 > 1) {
|
|
do {
|
|
r161.shift();
|
|
const r296 = r161[0];
|
|
r272 = r291;
|
|
if (r296) {
|
|
break;
|
|
}
|
|
length14 = r161.length;
|
|
r272 = r291;
|
|
} while (length14 > 1);
|
|
}
|
|
}
|
|
}
|
|
length6 = r161.length;
|
|
r173 = r272;
|
|
r172 = r161;
|
|
r174 = r8;
|
|
} else {
|
|
length6 = r160;
|
|
r172 = r161;
|
|
r173 = 0;
|
|
r174 = r8;
|
|
if (r8 === 0) {
|
|
r172 = [0];
|
|
length6 = r160;
|
|
r173 = 1;
|
|
r174 = r8;
|
|
}
|
|
}
|
|
r29[r162] = r173;
|
|
if (r174 && r172[0]) {
|
|
const r302 = +length6;
|
|
const r303 = r38[r158] || 0;
|
|
r301 = r302 + 1;
|
|
r172[r302] = r303;
|
|
r300 = r172;
|
|
} else {
|
|
r300 = [r38[r158]];
|
|
r301 = 1;
|
|
}
|
|
const r304 = +r158;
|
|
if (!(r304 < r39) && r300[0] === void 0) {
|
|
break;
|
|
}
|
|
r157 = r162 + 1;
|
|
r153 = r304 + 1;
|
|
r154 = r159 - 1;
|
|
r152 = r44;
|
|
r155 = r301;
|
|
r156 = r300;
|
|
} while (r159);
|
|
}
|
|
if (!r29[0]) {
|
|
r29.shift();
|
|
}
|
|
r74.e = r81;
|
|
let r327 = r82;
|
|
if (a3) {
|
|
let r329 = 7 * r74.e;
|
|
let r331 = r74.d[0];
|
|
let r333 = r329;
|
|
if (r331 >= 10) {
|
|
do {
|
|
r329 = r329 + 1;
|
|
r331 = r331 / 10;
|
|
r333 = r329;
|
|
} while (10 <= r331);
|
|
}
|
|
r327 = r82 + r333 + 1;
|
|
}
|
|
round(r74, r327);
|
|
return r74;
|
|
}
|
|
throw Error("[DecimalError] Division by zero");
|
|
}
|
|
return new constructor(a0);
|
|
};
|
|
clone = function clone(a0) {
|
|
"use strict";
|
|
let env25530;
|
|
const r7 = env25530 = {
|
|
$parent: env3508
|
|
};
|
|
let r6 = a0;
|
|
const r4 = $mk104609(r7);
|
|
env25530[0] = r4;
|
|
r4.prototype = c3508_11;
|
|
r4.ROUND_UP = 0;
|
|
r4.ROUND_DOWN = 1;
|
|
r4.ROUND_CEIL = 2;
|
|
r4.ROUND_FLOOR = 3;
|
|
r4.ROUND_HALF_UP = 4;
|
|
r4.ROUND_HALF_DOWN = 5;
|
|
r4.ROUND_HALF_EVEN = 6;
|
|
r4.ROUND_HALF_CEIL = 7;
|
|
r4.ROUND_HALF_FLOOR = 8;
|
|
r4.clone = clone;
|
|
const set = config;
|
|
r4.set = set;
|
|
r4.config = set;
|
|
if (a0 === void 0) {
|
|
r6 = {};
|
|
}
|
|
if (r6) {
|
|
const r19 = ["precision", "rounding", "toExpNeg", "toExpPos", "LN10"];
|
|
const r21 = 0 < r19.length;
|
|
let r22 = 0;
|
|
if (r21) {
|
|
do {
|
|
const hasOwnProperty = r6.hasOwnProperty;
|
|
const r9 = r19[r22];
|
|
const r24 = hasOwnProperty.call(r6, r9);
|
|
const r25 = r22;
|
|
if (!r24) {
|
|
r6[r9] = this[r9];
|
|
}
|
|
r22 = r25 + 1;
|
|
} while (r22 < r19.length);
|
|
}
|
|
}
|
|
r4.config(r6);
|
|
return r4;
|
|
};
|
|
const r12 = env3509 = {
|
|
$parent: r5
|
|
};
|
|
const Decimal2 = $mk104609(r12);
|
|
c3509_0 = Decimal2;
|
|
Decimal2.prototype = prototype;
|
|
let r0 = 0;
|
|
Decimal2.ROUND_UP = 0;
|
|
Decimal2.ROUND_DOWN = 1;
|
|
Decimal2.ROUND_CEIL = 2;
|
|
Decimal2.ROUND_FLOOR = 3;
|
|
Decimal2.ROUND_HALF_UP = 4;
|
|
Decimal2.ROUND_HALF_DOWN = 5;
|
|
Decimal2.ROUND_HALF_EVEN = 6;
|
|
Decimal2.ROUND_HALF_CEIL = 7;
|
|
Decimal2.ROUND_HALF_FLOOR = 8;
|
|
Decimal2.clone = clone;
|
|
Decimal2.set = config;
|
|
Decimal2.config = config;
|
|
const r73 = ["precision", "rounding", "toExpNeg", "toExpPos", "LN10"];
|
|
if (0 < r73.length) {
|
|
do {
|
|
const r77 = r73[r0];
|
|
const hasOwnProperty = r9.hasOwnProperty(r77);
|
|
const r79 = r0;
|
|
if (!hasOwnProperty) {
|
|
r9[r77] = (void 0)[r77];
|
|
}
|
|
r0 = r79 + 1;
|
|
} while (r0 < r73.length);
|
|
}
|
|
Decimal2.config(r9);
|
|
env3508[1] = Decimal2;
|
|
Decimal2.Decimal = Decimal2;
|
|
Decimal2.default = Decimal2;
|
|
const r85 = {
|
|
__proto__: Decimal2.prototype
|
|
};
|
|
const r86 = Decimal2.call(r85, 1);
|
|
c3508_0 = r86 instanceof Object ? r86 : r85;
|
|
if (typeof globalThis.define === "function" && define.amd) {
|
|
define(function() {
|
|
"use strict";
|
|
return env3508[1];
|
|
});
|
|
} else if (module !== void 0 && module.exports) {
|
|
module.exports = Decimal2;
|
|
} else {
|
|
this.Decimal = Decimal2;
|
|
}
|