solve-engine 1.0.2 → 1.1.0
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/dist/{BytecodeBuilder-B0xskcv5.d.cts → BytecodeBuilder-Bp9xeTmX.d.cts} +4 -0
- package/dist/{BytecodeBuilder-B0xskcv5.d.ts → BytecodeBuilder-Bp9xeTmX.d.ts} +4 -0
- package/dist/{Configuration-B-G5gTRn.d.cts → Configuration-C9W8tJv_.d.cts} +53 -1
- package/dist/{Configuration-B-G5gTRn.d.ts → Configuration-C9W8tJv_.d.ts} +53 -1
- package/dist/{EngineError-LU7W7AgI.d.cts → EngineError-B61GS1jp.d.cts} +14 -0
- package/dist/{EngineError-LU7W7AgI.d.ts → EngineError-B61GS1jp.d.ts} +14 -0
- package/dist/FormattingSettings-CJHyxcYu.d.cts +27 -0
- package/dist/FormattingSettings-CJHyxcYu.d.ts +27 -0
- package/dist/{Lexer-DpjdaQ98.d.cts → Lexer-BOs7euZe.d.cts} +28 -1
- package/dist/{Lexer-CNmWxabg.d.ts → Lexer-CSI_lwbW.d.ts} +28 -1
- package/dist/PackageCompatibility-B-7rK1TD.d.cts +76 -0
- package/dist/PackageCompatibility-Dh59eF-X.d.ts +76 -0
- package/dist/{PackageRegistry-zuzqt51V.d.cts → PackageRegistry-BHWJP83F.d.cts} +449 -11
- package/dist/{PackageRegistry-ClIFXxAe.d.ts → PackageRegistry-_8rDlvxI.d.ts} +449 -11
- package/dist/{Parselet-BaySkMV3.d.ts → Parselet-BBT8riYh.d.ts} +12 -3
- package/dist/{Parselet-DuI1Pjiq.d.cts → Parselet-BHcgK9S7.d.cts} +12 -3
- package/dist/{ScopeManager-B6GzdhVG.d.cts → ScopeManager-8vf02dwj.d.cts} +56 -5
- package/dist/{ScopeManager-udv4Twwq.d.ts → ScopeManager-CxA24W5n.d.ts} +56 -5
- package/dist/{Token-BzG5G4ja.d.cts → Token-B1hdkedD.d.cts} +9 -0
- package/dist/{Token-BzG5G4ja.d.ts → Token-B1hdkedD.d.ts} +9 -0
- package/dist/{TokenNormalizer-t_GotBxr.d.ts → TokenNormalizer-C6VzZgHa.d.ts} +1 -1
- package/dist/{TokenNormalizer-DGVa24Q-.d.cts → TokenNormalizer-DRc1Js1V.d.cts} +1 -1
- package/dist/{VMCheckpoints-DwLjivM7.d.cts → VMCheckpoints-ELYqITdF.d.cts} +3 -3
- package/dist/{VMCheckpoints-BiaIlOOY.d.ts → VMCheckpoints-MK--EBH2.d.ts} +3 -3
- package/dist/{Value-CXJqDH9J.d.cts → Value-BUi1RA3S.d.cts} +124 -5
- package/dist/{Value-CXJqDH9J.d.ts → Value-BUi1RA3S.d.ts} +124 -5
- package/dist/WorkerError-_-RkoQ5P.d.ts +75 -0
- package/dist/WorkerError-gzmaopj2.d.cts +75 -0
- package/dist/{chunk-GQCOSXMG.js → chunk-267JPOTF.js} +43 -5
- package/dist/chunk-267JPOTF.js.map +1 -0
- package/dist/{chunk-JMXUNXQS.cjs → chunk-2TZKENDH.cjs} +51 -8
- package/dist/chunk-2TZKENDH.cjs.map +1 -0
- package/dist/chunk-3OWCDIPN.js +215 -0
- package/dist/chunk-3OWCDIPN.js.map +1 -0
- package/dist/{chunk-VB37OC6I.js → chunk-4D6NIHE2.js} +40 -3
- package/dist/chunk-4D6NIHE2.js.map +1 -0
- package/dist/{chunk-TY3TLZAW.cjs → chunk-536WPM2V.cjs} +18 -2
- package/dist/chunk-536WPM2V.cjs.map +1 -0
- package/dist/chunk-5HRB36DK.js +405 -0
- package/dist/chunk-5HRB36DK.js.map +1 -0
- package/dist/chunk-5ON7PUAZ.js +12 -0
- package/dist/chunk-5ON7PUAZ.js.map +1 -0
- package/dist/{chunk-KV7UW6T6.js → chunk-7KYSUDQO.js} +12 -5
- package/dist/chunk-7KYSUDQO.js.map +1 -0
- package/dist/{chunk-6WFMPTGB.cjs → chunk-7ZX6B7SY.cjs} +774 -528
- package/dist/chunk-7ZX6B7SY.cjs.map +1 -0
- package/dist/chunk-ALYRJ72W.cjs +434 -0
- package/dist/chunk-ALYRJ72W.cjs.map +1 -0
- package/dist/{chunk-5KMIY374.cjs → chunk-B4HBEFTB.cjs} +17 -2
- package/dist/chunk-B4HBEFTB.cjs.map +1 -0
- package/dist/chunk-B7NLZMQ3.cjs +74 -0
- package/dist/chunk-B7NLZMQ3.cjs.map +1 -0
- package/dist/{chunk-UQ3UIZJC.js → chunk-BLI4NIQY.js} +6 -2
- package/dist/chunk-BLI4NIQY.js.map +1 -0
- package/dist/{chunk-T556MJDZ.cjs → chunk-C75AFGVD.cjs} +11 -11
- package/dist/{chunk-T556MJDZ.cjs.map → chunk-C75AFGVD.cjs.map} +1 -1
- package/dist/{chunk-G535KJEG.js → chunk-CCBZZQAE.js} +2 -2
- package/dist/{chunk-G535KJEG.js.map → chunk-CCBZZQAE.js.map} +1 -1
- package/dist/chunk-CKQMXMHR.cjs +219 -0
- package/dist/chunk-CKQMXMHR.cjs.map +1 -0
- package/dist/{chunk-PFUESQTW.cjs → chunk-EJ3ILXX6.cjs} +48 -2
- package/dist/chunk-EJ3ILXX6.cjs.map +1 -0
- package/dist/{chunk-526PMQOA.js → chunk-ENKKJYD3.js} +10 -4
- package/dist/chunk-ENKKJYD3.js.map +1 -0
- package/dist/{chunk-5X2PTP6F.cjs → chunk-ENRIK36Q.cjs} +2 -12
- package/dist/chunk-ENRIK36Q.cjs.map +1 -0
- package/dist/{chunk-3D7V24DG.js → chunk-ERCOHGXD.js} +17 -2
- package/dist/chunk-ERCOHGXD.js.map +1 -0
- package/dist/{chunk-IF532O7C.js → chunk-FD5ZZHEU.js} +3 -12
- package/dist/chunk-FD5ZZHEU.js.map +1 -0
- package/dist/{chunk-7FSDNNNC.js → chunk-G7Z4HJQA.js} +11 -5
- package/dist/chunk-G7Z4HJQA.js.map +1 -0
- package/dist/{chunk-FQGX2PA2.js → chunk-GQMUHVE3.js} +115 -4
- package/dist/chunk-GQMUHVE3.js.map +1 -0
- package/dist/chunk-GUG7SNSV.js +1764 -0
- package/dist/chunk-GUG7SNSV.js.map +1 -0
- package/dist/{chunk-UM6BVY2S.cjs → chunk-HIQ5HSZL.cjs} +175 -43
- package/dist/chunk-HIQ5HSZL.cjs.map +1 -0
- package/dist/{chunk-HVQFNJKE.cjs → chunk-HVRVSI2Z.cjs} +104 -86
- package/dist/chunk-HVRVSI2Z.cjs.map +1 -0
- package/dist/{chunk-3LAEG75D.js → chunk-I4GAWIPW.js} +24 -6
- package/dist/chunk-I4GAWIPW.js.map +1 -0
- package/dist/{chunk-PA4VC73I.cjs → chunk-J45BCEZ4.cjs} +33 -27
- package/dist/chunk-J45BCEZ4.cjs.map +1 -0
- package/dist/{chunk-NG2JHZHE.js → chunk-JIPATHVY.js} +1853 -2640
- package/dist/chunk-JIPATHVY.js.map +1 -0
- package/dist/{chunk-IP7ASJEW.js → chunk-JJIXHXFQ.js} +5 -5
- package/dist/{chunk-IP7ASJEW.js.map → chunk-JJIXHXFQ.js.map} +1 -1
- package/dist/chunk-L2TE7PMO.cjs +14 -0
- package/dist/chunk-L2TE7PMO.cjs.map +1 -0
- package/dist/{chunk-HBVFFBRR.cjs → chunk-MG6Q3DUO.cjs} +1962 -2748
- package/dist/chunk-MG6Q3DUO.cjs.map +1 -0
- package/dist/{chunk-R3PY4G7J.js → chunk-MVTOCRV2.js} +48 -3
- package/dist/chunk-MVTOCRV2.js.map +1 -0
- package/dist/{chunk-Y7FT4IQT.js → chunk-NKW7LKYU.js} +266 -28
- package/dist/chunk-NKW7LKYU.js.map +1 -0
- package/dist/{chunk-O3ANBHSA.js → chunk-NNQ2TYDF.js} +123 -5
- package/dist/chunk-NNQ2TYDF.js.map +1 -0
- package/dist/{chunk-AA3KTWTX.js → chunk-OADDUPT3.js} +4 -4
- package/dist/{chunk-AA3KTWTX.js.map → chunk-OADDUPT3.js.map} +1 -1
- package/dist/{chunk-SESSWASV.cjs → chunk-OTN6SZOD.cjs} +1868 -393
- package/dist/chunk-OTN6SZOD.cjs.map +1 -0
- package/dist/{chunk-5LI5EPGJ.cjs → chunk-QFTDTX6K.cjs} +40 -3
- package/dist/chunk-QFTDTX6K.cjs.map +1 -0
- package/dist/{chunk-YXCTLWOH.js → chunk-RRLHC37V.js} +1530 -57
- package/dist/chunk-RRLHC37V.js.map +1 -0
- package/dist/chunk-SNHVVOJK.cjs +1768 -0
- package/dist/chunk-SNHVVOJK.cjs.map +1 -0
- package/dist/{chunk-HDP7VK3C.cjs → chunk-SRGQ72IR.cjs} +649 -349
- package/dist/chunk-SRGQ72IR.cjs.map +1 -0
- package/dist/{chunk-4B2CNWQU.cjs → chunk-SSV46KFA.cjs} +14 -7
- package/dist/chunk-SSV46KFA.cjs.map +1 -0
- package/dist/{chunk-AJA6LUI7.js → chunk-UO6BUV6K.js} +18 -2
- package/dist/chunk-UO6BUV6K.js.map +1 -0
- package/dist/chunk-WWQEY7BV.js +67 -0
- package/dist/chunk-WWQEY7BV.js.map +1 -0
- package/dist/{chunk-5WVP4YHP.js → chunk-WXEHD6TT.js} +333 -33
- package/dist/chunk-WXEHD6TT.js.map +1 -0
- package/dist/{chunk-47LRVGOT.cjs → chunk-XA4CKRML.cjs} +2 -2
- package/dist/{chunk-47LRVGOT.cjs.map → chunk-XA4CKRML.cjs.map} +1 -1
- package/dist/{chunk-6KFYJ6TD.cjs → chunk-XIYYHA65.cjs} +6 -2
- package/dist/chunk-XIYYHA65.cjs.map +1 -0
- package/dist/{chunk-FE23VSSA.cjs → chunk-XJGJCF2R.cjs} +6 -6
- package/dist/{chunk-FE23VSSA.cjs.map → chunk-XJGJCF2R.cjs.map} +1 -1
- package/dist/{chunk-R7YVBHCV.cjs → chunk-YTIYVHL7.cjs} +184 -73
- package/dist/chunk-YTIYVHL7.cjs.map +1 -0
- package/dist/{chunk-TMA4RCEN.js → chunk-Z7XGGLI2.js} +3 -3
- package/dist/{chunk-TMA4RCEN.js.map → chunk-Z7XGGLI2.js.map} +1 -1
- package/dist/{chunk-A2N2GFCG.cjs → chunk-ZVTWQLK4.cjs} +10 -10
- package/dist/{chunk-A2N2GFCG.cjs.map → chunk-ZVTWQLK4.cjs.map} +1 -1
- package/dist/{chunk-524F3ATQ.cjs → chunk-ZXCESUJS.cjs} +15 -9
- package/dist/chunk-ZXCESUJS.cjs.map +1 -0
- package/dist/constants.cjs +5 -5
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +2 -2
- package/dist/engine.cjs +52 -35
- package/dist/engine.d.cts +13 -13
- package/dist/engine.d.ts +13 -13
- package/dist/engine.js +26 -21
- package/dist/errors.cjs +44 -19
- package/dist/errors.d.cts +3 -2
- package/dist/errors.d.ts +3 -2
- package/dist/errors.js +2 -1
- package/dist/format.cjs +19 -169
- package/dist/format.cjs.map +1 -1
- package/dist/format.d.cts +18 -26
- package/dist/format.d.ts +18 -26
- package/dist/format.js +7 -171
- package/dist/format.js.map +1 -1
- package/dist/index.cjs +250 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +110 -74
- package/dist/index.d.ts +110 -74
- package/dist/index.js +228 -23
- package/dist/index.js.map +1 -1
- package/dist/language.cjs +9 -9
- package/dist/language.d.cts +12 -12
- package/dist/language.d.ts +12 -12
- package/dist/language.js +3 -3
- package/dist/lexer.cjs +16 -16
- package/dist/lexer.d.cts +3 -3
- package/dist/lexer.d.ts +3 -3
- package/dist/lexer.js +5 -5
- package/dist/normalizer.cjs +10 -10
- package/dist/normalizer.d.cts +3 -3
- package/dist/normalizer.d.ts +3 -3
- package/dist/normalizer.js +4 -4
- package/dist/packages.cjs +45 -36
- package/dist/packages.d.cts +135 -31
- package/dist/packages.d.ts +135 -31
- package/dist/packages.js +14 -13
- package/dist/parser.cjs +16 -16
- package/dist/parser.d.cts +6 -5
- package/dist/parser.d.ts +6 -5
- package/dist/parser.js +6 -6
- package/dist/{pipeline-BEb3hujr.d.cts → pipeline-CtfJtPQc.d.cts} +3 -3
- package/dist/{pipeline-B6k5lCB7.d.ts → pipeline-DCd5M6Gk.d.ts} +3 -3
- package/dist/resolvers.d.cts +3 -3
- package/dist/resolvers.d.ts +3 -3
- package/dist/testing.cjs +478 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +271 -0
- package/dist/testing.d.ts +271 -0
- package/dist/testing.js +470 -0
- package/dist/testing.js.map +1 -0
- package/dist/uom.cjs +16 -16
- package/dist/uom.d.cts +3 -3
- package/dist/uom.d.ts +3 -3
- package/dist/uom.js +6 -6
- package/dist/utilities.cjs +6 -5
- package/dist/utilities.js +2 -1
- package/dist/vm.cjs +34 -34
- package/dist/vm.d.cts +8 -8
- package/dist/vm.d.ts +8 -8
- package/dist/vm.js +9 -9
- package/dist/worker.cjs +493 -0
- package/dist/worker.cjs.map +1 -0
- package/dist/worker.d.cts +509 -0
- package/dist/worker.d.ts +509 -0
- package/dist/worker.js +484 -0
- package/dist/worker.js.map +1 -0
- package/package.json +21 -1
- package/dist/chunk-3D7V24DG.js.map +0 -1
- package/dist/chunk-3LAEG75D.js.map +0 -1
- package/dist/chunk-4B2CNWQU.cjs.map +0 -1
- package/dist/chunk-524F3ATQ.cjs.map +0 -1
- package/dist/chunk-526PMQOA.js.map +0 -1
- package/dist/chunk-5KMIY374.cjs.map +0 -1
- package/dist/chunk-5LI5EPGJ.cjs.map +0 -1
- package/dist/chunk-5WVP4YHP.js.map +0 -1
- package/dist/chunk-5X2PTP6F.cjs.map +0 -1
- package/dist/chunk-6KFYJ6TD.cjs.map +0 -1
- package/dist/chunk-6WFMPTGB.cjs.map +0 -1
- package/dist/chunk-7FSDNNNC.js.map +0 -1
- package/dist/chunk-AJA6LUI7.js.map +0 -1
- package/dist/chunk-FQGX2PA2.js.map +0 -1
- package/dist/chunk-GQCOSXMG.js.map +0 -1
- package/dist/chunk-HBVFFBRR.cjs.map +0 -1
- package/dist/chunk-HDP7VK3C.cjs.map +0 -1
- package/dist/chunk-HVQFNJKE.cjs.map +0 -1
- package/dist/chunk-IF532O7C.js.map +0 -1
- package/dist/chunk-JMXUNXQS.cjs.map +0 -1
- package/dist/chunk-KV7UW6T6.js.map +0 -1
- package/dist/chunk-NG2JHZHE.js.map +0 -1
- package/dist/chunk-O3ANBHSA.js.map +0 -1
- package/dist/chunk-PA4VC73I.cjs.map +0 -1
- package/dist/chunk-PFUESQTW.cjs.map +0 -1
- package/dist/chunk-R3PY4G7J.js.map +0 -1
- package/dist/chunk-R7YVBHCV.cjs.map +0 -1
- package/dist/chunk-SESSWASV.cjs.map +0 -1
- package/dist/chunk-TY3TLZAW.cjs.map +0 -1
- package/dist/chunk-UM6BVY2S.cjs.map +0 -1
- package/dist/chunk-UQ3UIZJC.js.map +0 -1
- package/dist/chunk-VB37OC6I.js.map +0 -1
- package/dist/chunk-Y7FT4IQT.js.map +0 -1
- package/dist/chunk-YXCTLWOH.js.map +0 -1
|
@@ -1,7 +1,125 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk2TZKENDH_cjs = require('./chunk-2TZKENDH.cjs');
|
|
4
|
+
var chunkB4HBEFTB_cjs = require('./chunk-B4HBEFTB.cjs');
|
|
5
|
+
|
|
6
|
+
// src/decimal/Decimal.ts
|
|
7
|
+
var DEFAULT_DIVISION_SCALE = 20;
|
|
8
|
+
var POW10 = [1n];
|
|
9
|
+
function pow10(n) {
|
|
10
|
+
if (n < 0) {
|
|
11
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.internal("DECIMAL_NEGATIVE_POWER", `pow10 needs a non-negative exponent, got ${n}`, { exponent: n });
|
|
12
|
+
}
|
|
13
|
+
for (let i = POW10.length; i <= n; i++) POW10[i] = POW10[i - 1] * 10n;
|
|
14
|
+
return POW10[n];
|
|
15
|
+
}
|
|
16
|
+
function decimalFromInteger(n) {
|
|
17
|
+
return { coef: typeof n === "bigint" ? n : BigInt(n), scale: 0 };
|
|
18
|
+
}
|
|
19
|
+
function decimalFromNumberIfExact(n) {
|
|
20
|
+
if (!Number.isFinite(n) || !Number.isInteger(n)) return null;
|
|
21
|
+
return decimalFromInteger(BigInt(n));
|
|
22
|
+
}
|
|
23
|
+
function decimalFromLiteral(text) {
|
|
24
|
+
let s = text;
|
|
25
|
+
let negative = false;
|
|
26
|
+
if (s.startsWith("-")) {
|
|
27
|
+
negative = true;
|
|
28
|
+
s = s.slice(1);
|
|
29
|
+
} else if (s.startsWith("+")) {
|
|
30
|
+
s = s.slice(1);
|
|
31
|
+
}
|
|
32
|
+
const dot = s.indexOf(".");
|
|
33
|
+
const intPart = dot < 0 ? s : s.slice(0, dot);
|
|
34
|
+
const fracPart = dot < 0 ? "" : s.slice(dot + 1);
|
|
35
|
+
const digits = intPart + fracPart || "0";
|
|
36
|
+
if (!/^[0-9]+$/.test(digits)) {
|
|
37
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.parsing("INVALID_DECIMAL_LITERAL", `Not a decimal literal: "${text}"`, { raw: text });
|
|
38
|
+
}
|
|
39
|
+
let coef = BigInt(digits);
|
|
40
|
+
if (negative) coef = -coef;
|
|
41
|
+
return { coef, scale: fracPart.length };
|
|
42
|
+
}
|
|
43
|
+
function align(a, b) {
|
|
44
|
+
if (a.scale === b.scale) return { ca: a.coef, cb: b.coef, scale: a.scale };
|
|
45
|
+
if (a.scale > b.scale) return { ca: a.coef, cb: b.coef * pow10(a.scale - b.scale), scale: a.scale };
|
|
46
|
+
return { ca: a.coef * pow10(b.scale - a.scale), cb: b.coef, scale: b.scale };
|
|
47
|
+
}
|
|
48
|
+
function decimalAdd(a, b) {
|
|
49
|
+
const { ca, cb, scale } = align(a, b);
|
|
50
|
+
return { coef: ca + cb, scale };
|
|
51
|
+
}
|
|
52
|
+
function decimalSubtract(a, b) {
|
|
53
|
+
const { ca, cb, scale } = align(a, b);
|
|
54
|
+
return { coef: ca - cb, scale };
|
|
55
|
+
}
|
|
56
|
+
function decimalMultiply(a, b) {
|
|
57
|
+
return { coef: a.coef * b.coef, scale: a.scale + b.scale };
|
|
58
|
+
}
|
|
59
|
+
function decimalNegate(a) {
|
|
60
|
+
return { coef: -a.coef, scale: a.scale };
|
|
61
|
+
}
|
|
62
|
+
function decimalIsZero(a) {
|
|
63
|
+
return a.coef === 0n;
|
|
64
|
+
}
|
|
65
|
+
function roundCoefToScale(coef, scale, targetScale) {
|
|
66
|
+
if (targetScale >= scale) return coef * pow10(targetScale - scale);
|
|
67
|
+
const divisor = pow10(scale - targetScale);
|
|
68
|
+
const negative = coef < 0n;
|
|
69
|
+
const magnitude = negative ? -coef : coef;
|
|
70
|
+
let q = magnitude / divisor;
|
|
71
|
+
const r = magnitude % divisor;
|
|
72
|
+
if (r * 2n >= divisor) q += 1n;
|
|
73
|
+
return negative ? -q : q;
|
|
74
|
+
}
|
|
75
|
+
function decimalRound(a, targetScale) {
|
|
76
|
+
return { coef: roundCoefToScale(a.coef, a.scale, targetScale), scale: targetScale };
|
|
77
|
+
}
|
|
78
|
+
function decimalDivide(a, b, maxFractionDigits = DEFAULT_DIVISION_SCALE) {
|
|
79
|
+
if (decimalIsZero(b)) {
|
|
80
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.internal("DECIMAL_DIVISION_BY_ZERO", "decimalDivide was called with a zero divisor", {});
|
|
81
|
+
}
|
|
82
|
+
const s = maxFractionDigits;
|
|
83
|
+
const numerator = a.coef * pow10(s + b.scale);
|
|
84
|
+
const denominator = b.coef * pow10(a.scale);
|
|
85
|
+
const negative = numerator < 0n !== denominator < 0n;
|
|
86
|
+
const num = numerator < 0n ? -numerator : numerator;
|
|
87
|
+
const den = denominator < 0n ? -denominator : denominator;
|
|
88
|
+
let q = num / den;
|
|
89
|
+
const r = num % den;
|
|
90
|
+
if (r * 2n >= den) q += 1n;
|
|
91
|
+
return { coef: negative ? -q : q, scale: s };
|
|
92
|
+
}
|
|
93
|
+
function decimalCompare(a, b) {
|
|
94
|
+
const { ca, cb } = align(a, b);
|
|
95
|
+
if (ca < cb) return -1;
|
|
96
|
+
if (ca > cb) return 1;
|
|
97
|
+
return 0;
|
|
98
|
+
}
|
|
99
|
+
function decimalToString(a) {
|
|
100
|
+
const negative = a.coef < 0n;
|
|
101
|
+
let digits = (negative ? -a.coef : a.coef).toString();
|
|
102
|
+
if (a.scale === 0) return negative ? `-${digits}` : digits;
|
|
103
|
+
if (digits.length <= a.scale) digits = digits.padStart(a.scale + 1, "0");
|
|
104
|
+
const cut = digits.length - a.scale;
|
|
105
|
+
const whole = digits.slice(0, cut);
|
|
106
|
+
const frac = digits.slice(cut);
|
|
107
|
+
return `${negative ? "-" : ""}${whole}.${frac}`;
|
|
108
|
+
}
|
|
109
|
+
function decimalToNumber(a) {
|
|
110
|
+
return Number(decimalToString(a));
|
|
111
|
+
}
|
|
112
|
+
function decimalToFixed(a, fractionDigits) {
|
|
113
|
+
const rounded = decimalRound(a, fractionDigits);
|
|
114
|
+
const negative = rounded.coef < 0n && rounded.coef !== 0n;
|
|
115
|
+
let digits = (rounded.coef < 0n ? -rounded.coef : rounded.coef).toString();
|
|
116
|
+
if (fractionDigits === 0) return negative ? `-${digits}` : digits;
|
|
117
|
+
if (digits.length <= fractionDigits) digits = digits.padStart(fractionDigits + 1, "0");
|
|
118
|
+
const cut = digits.length - fractionDigits;
|
|
119
|
+
const whole = digits.slice(0, cut);
|
|
120
|
+
const frac = digits.slice(cut);
|
|
121
|
+
return `${negative ? "-" : ""}${whole}.${frac}`;
|
|
122
|
+
}
|
|
5
123
|
|
|
6
124
|
// src/symbolic/Rational.ts
|
|
7
125
|
var RATIONAL_ZERO = { n: 0n, d: 1n };
|
|
@@ -33,7 +151,7 @@ function gcd(a, b) {
|
|
|
33
151
|
function guardMagnitude(n, d) {
|
|
34
152
|
const magnitude = n < 0n ? -n : n;
|
|
35
153
|
if (magnitude >= MAX_MAGNITUDE || d >= MAX_MAGNITUDE) {
|
|
36
|
-
throw
|
|
154
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.execution(
|
|
37
155
|
"SYMBOLIC_RATIONAL_OVERFLOW",
|
|
38
156
|
`This calculation produced a fraction too large to represent exactly (over ${RATIONAL_MAX_BITS} bits).`,
|
|
39
157
|
{ limitBits: RATIONAL_MAX_BITS }
|
|
@@ -42,7 +160,7 @@ function guardMagnitude(n, d) {
|
|
|
42
160
|
}
|
|
43
161
|
function normalize(n, d) {
|
|
44
162
|
if (d === 0n) {
|
|
45
|
-
throw
|
|
163
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.execution("SYMBOLIC_DIVISION_BY_ZERO", "Division by zero in a symbolic expression.");
|
|
46
164
|
}
|
|
47
165
|
if (n === 0n) return RATIONAL_ZERO;
|
|
48
166
|
let numerator = d < 0n ? -n : n;
|
|
@@ -59,7 +177,7 @@ function rational(numerator, denominator = 1n) {
|
|
|
59
177
|
var DECIMAL_FORM = /^(-?)(\d+)(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/;
|
|
60
178
|
function rationalFromNumber(value) {
|
|
61
179
|
if (!Number.isFinite(value)) {
|
|
62
|
-
throw
|
|
180
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.execution(
|
|
63
181
|
"SYMBOLIC_NONFINITE_OPERAND",
|
|
64
182
|
`"${String(value)}" has no exact value, so it cannot appear in a symbolic expression.`,
|
|
65
183
|
{ value: String(value) }
|
|
@@ -68,7 +186,7 @@ function rationalFromNumber(value) {
|
|
|
68
186
|
if (Number.isInteger(value)) return normalize(BigInt(value), 1n);
|
|
69
187
|
const parts = DECIMAL_FORM.exec(String(value));
|
|
70
188
|
if (parts === null) {
|
|
71
|
-
throw
|
|
189
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.internal(
|
|
72
190
|
"INTERNAL_RATIONAL_PARSE",
|
|
73
191
|
`Internal error: could not read "${String(value)}" as a decimal number.`,
|
|
74
192
|
{ value: String(value) }
|
|
@@ -100,7 +218,7 @@ function rationalMul(a, b) {
|
|
|
100
218
|
}
|
|
101
219
|
function rationalDiv(a, b) {
|
|
102
220
|
if (b.n === 0n) {
|
|
103
|
-
throw
|
|
221
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.execution("SYMBOLIC_DIVISION_BY_ZERO", "Division by zero in a symbolic expression.");
|
|
104
222
|
}
|
|
105
223
|
return normalize(a.n * b.d, a.d * b.n);
|
|
106
224
|
}
|
|
@@ -111,7 +229,7 @@ function rationalPow(base, exponent) {
|
|
|
111
229
|
if (exponent === 0n) return RATIONAL_ONE;
|
|
112
230
|
if (exponent < 0n) {
|
|
113
231
|
if (base.n === 0n) {
|
|
114
|
-
throw
|
|
232
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.execution("SYMBOLIC_DIVISION_BY_ZERO", "Zero raised to a negative power is undefined.");
|
|
115
233
|
}
|
|
116
234
|
const positive = -exponent;
|
|
117
235
|
return normalize(bigintPow(base.d, positive), bigintPow(base.n, positive));
|
|
@@ -191,7 +309,7 @@ function complexMul(a, b) {
|
|
|
191
309
|
}
|
|
192
310
|
function complexDiv(a, b) {
|
|
193
311
|
if (isComplexZero(b)) {
|
|
194
|
-
throw
|
|
312
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.execution("SYMBOLIC_DIVISION_BY_ZERO", "Division by zero in a complex expression.");
|
|
195
313
|
}
|
|
196
314
|
const denominator = rationalAdd(rationalMul(b.re, b.re), rationalMul(b.im, b.im));
|
|
197
315
|
return {
|
|
@@ -212,7 +330,7 @@ function complexPow(base, exponent) {
|
|
|
212
330
|
if (exponent === 0n) return COMPLEX_ONE;
|
|
213
331
|
if (exponent < 0n) {
|
|
214
332
|
if (isComplexZero(base)) {
|
|
215
|
-
throw
|
|
333
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.execution("SYMBOLIC_DIVISION_BY_ZERO", "Zero raised to a negative power is undefined.");
|
|
216
334
|
}
|
|
217
335
|
return complexDiv(COMPLEX_ONE, complexPow(base, -exponent));
|
|
218
336
|
}
|
|
@@ -925,7 +1043,7 @@ function foldCall(name, args) {
|
|
|
925
1043
|
}
|
|
926
1044
|
function simplifySymbolic(node) {
|
|
927
1045
|
if (nodeCount(node, SYMBOLIC_MAX_NODES) > SYMBOLIC_MAX_NODES) {
|
|
928
|
-
throw
|
|
1046
|
+
throw chunkB4HBEFTB_cjs.ErrorFactory.execution(
|
|
929
1047
|
"SYMBOLIC_NODE_LIMIT_EXCEEDED",
|
|
930
1048
|
`This symbolic expression is too large to simplify (over ${SYMBOLIC_MAX_NODES} terms).`,
|
|
931
1049
|
{ limit: SYMBOLIC_MAX_NODES }
|
|
@@ -1277,9 +1395,9 @@ function symbolicToEntry(node) {
|
|
|
1277
1395
|
return simplified.kind === "const" ? rationalToNumber(simplified.value) : simplified;
|
|
1278
1396
|
}
|
|
1279
1397
|
function matrixEntryToValue(cell) {
|
|
1280
|
-
if (typeof cell === "boolean") return
|
|
1281
|
-
if (typeof cell === "object" && cell !== null) return
|
|
1282
|
-
return
|
|
1398
|
+
if (typeof cell === "boolean") return chunk2TZKENDH_cjs.boolValue(cell);
|
|
1399
|
+
if (typeof cell === "object" && cell !== null) return chunk2TZKENDH_cjs.symbolicValue(cell);
|
|
1400
|
+
return chunk2TZKENDH_cjs.numberValue(cell);
|
|
1283
1401
|
}
|
|
1284
1402
|
function rowMajorToColumnMajor(rows, cols, rowMajorData) {
|
|
1285
1403
|
const data = new Array(rows * cols);
|
|
@@ -1308,21 +1426,21 @@ function matrixMultiply(l, r) {
|
|
|
1308
1426
|
if (useSymbolic) {
|
|
1309
1427
|
const scalarNode = entryToSymbolic(scalarOperand.data[0]);
|
|
1310
1428
|
const result2 = matrixOperand.data.map((v) => symbolicToEntry(simplifySymbolic({ kind: "mul", left: entryToSymbolic(v), right: scalarNode })));
|
|
1311
|
-
return
|
|
1429
|
+
return chunk2TZKENDH_cjs.matrixValue(matrixOperand.rows, matrixOperand.cols, result2);
|
|
1312
1430
|
}
|
|
1313
1431
|
const scalar = scalarOperand.data[0];
|
|
1314
1432
|
const result = matrixOperand.data.map((v) => v * scalar);
|
|
1315
|
-
return
|
|
1433
|
+
return chunk2TZKENDH_cjs.matrixValue(matrixOperand.rows, matrixOperand.cols, result);
|
|
1316
1434
|
}
|
|
1317
1435
|
if (l.cols !== r.rows) {
|
|
1318
|
-
return
|
|
1436
|
+
return chunk2TZKENDH_cjs.errorValue(
|
|
1319
1437
|
"DIMENSION_MISMATCH",
|
|
1320
1438
|
`Cannot multiply a ${l.rows}x${l.cols} matrix by a ${r.rows}x${r.cols} matrix \u2014 inner dimensions must match (${l.cols} !== ${r.rows}).`
|
|
1321
1439
|
);
|
|
1322
1440
|
}
|
|
1323
1441
|
const resultRows = l.rows;
|
|
1324
1442
|
const resultCols = r.cols;
|
|
1325
|
-
const data =
|
|
1443
|
+
const data = chunk2TZKENDH_cjs.checkedArray(resultRows * resultCols, "matrix cells");
|
|
1326
1444
|
for (let row = 0; row < resultRows; row++) {
|
|
1327
1445
|
for (let col = 0; col < resultCols; col++) {
|
|
1328
1446
|
if (useSymbolic) {
|
|
@@ -1341,14 +1459,14 @@ function matrixMultiply(l, r) {
|
|
|
1341
1459
|
}
|
|
1342
1460
|
}
|
|
1343
1461
|
}
|
|
1344
|
-
return
|
|
1462
|
+
return chunk2TZKENDH_cjs.matrixValue(resultRows, resultCols, data);
|
|
1345
1463
|
}
|
|
1346
1464
|
function matrixPower(m, exponent) {
|
|
1347
1465
|
if (!isSquare(m)) {
|
|
1348
|
-
return
|
|
1466
|
+
return chunk2TZKENDH_cjs.errorValue("MATRIX_POWER_REQUIRES_SQUARE_MATRIX", `^: only a square matrix can be raised to a power (got ${m.rows}x${m.cols}).`);
|
|
1349
1467
|
}
|
|
1350
1468
|
if (!Number.isInteger(exponent) || exponent < 0) {
|
|
1351
|
-
return
|
|
1469
|
+
return chunk2TZKENDH_cjs.errorValue(
|
|
1352
1470
|
"MATRIX_POWER_REQUIRES_WHOLE_EXPONENT",
|
|
1353
1471
|
`^: a matrix can only be raised to a whole number of 0 or more (got ${exponent}); "^-1" means the inverse and "^T" the transpose.`
|
|
1354
1472
|
);
|
|
@@ -1372,18 +1490,18 @@ function matrixPower(m, exponent) {
|
|
|
1372
1490
|
squared = doubled.value;
|
|
1373
1491
|
}
|
|
1374
1492
|
}
|
|
1375
|
-
return
|
|
1493
|
+
return chunk2TZKENDH_cjs.matrixValue(accumulated.rows, accumulated.cols, accumulated.data);
|
|
1376
1494
|
}
|
|
1377
1495
|
function matrixCompare(l, r, cmp) {
|
|
1378
1496
|
if (!sameShape(l, r)) {
|
|
1379
|
-
return
|
|
1497
|
+
return chunk2TZKENDH_cjs.errorValue(
|
|
1380
1498
|
"DIMENSION_MISMATCH",
|
|
1381
1499
|
`Cannot compare matrices of different shapes: ${l.rows}x${l.cols} and ${r.rows}x${r.cols}`
|
|
1382
1500
|
);
|
|
1383
1501
|
}
|
|
1384
1502
|
const data = new Array(l.data.length);
|
|
1385
1503
|
for (let i = 0; i < l.data.length; i++) data[i] = cmp(l.data[i], r.data[i]);
|
|
1386
|
-
return
|
|
1504
|
+
return chunk2TZKENDH_cjs.matrixValue(l.rows, l.cols, data);
|
|
1387
1505
|
}
|
|
1388
1506
|
function transpose(m) {
|
|
1389
1507
|
const data = new Array(m.rows * m.cols);
|
|
@@ -1392,7 +1510,7 @@ function transpose(m) {
|
|
|
1392
1510
|
data[r + c * m.cols] = matAt(m, c, r);
|
|
1393
1511
|
}
|
|
1394
1512
|
}
|
|
1395
|
-
return
|
|
1513
|
+
return chunk2TZKENDH_cjs.matrixValue(m.cols, m.rows, data);
|
|
1396
1514
|
}
|
|
1397
1515
|
function toWorkingRows(m) {
|
|
1398
1516
|
const rows = [];
|
|
@@ -1448,7 +1566,7 @@ function integerDeterminant(rows) {
|
|
|
1448
1566
|
}
|
|
1449
1567
|
function numericDeterminant(m) {
|
|
1450
1568
|
const integers = toIntegerRows(m);
|
|
1451
|
-
if (integers !== null) return
|
|
1569
|
+
if (integers !== null) return chunk2TZKENDH_cjs.numberValue(Number(integerDeterminant(integers)));
|
|
1452
1570
|
const n = m.rows;
|
|
1453
1571
|
const a = toWorkingRows(m);
|
|
1454
1572
|
let det = 1;
|
|
@@ -1461,7 +1579,7 @@ function numericDeterminant(m) {
|
|
|
1461
1579
|
pivotRow = r;
|
|
1462
1580
|
}
|
|
1463
1581
|
}
|
|
1464
|
-
if (maxAbs === 0) return
|
|
1582
|
+
if (maxAbs === 0) return chunk2TZKENDH_cjs.numberValue(0);
|
|
1465
1583
|
if (pivotRow !== col) {
|
|
1466
1584
|
const tmp = a[col];
|
|
1467
1585
|
a[col] = a[pivotRow];
|
|
@@ -1475,7 +1593,7 @@ function numericDeterminant(m) {
|
|
|
1475
1593
|
for (let c = col; c < n; c++) a[r][c] -= factor * a[col][c];
|
|
1476
1594
|
}
|
|
1477
1595
|
}
|
|
1478
|
-
return
|
|
1596
|
+
return chunk2TZKENDH_cjs.numberValue(det);
|
|
1479
1597
|
}
|
|
1480
1598
|
function symbolicDeterminant(m) {
|
|
1481
1599
|
const n = m.rows;
|
|
@@ -1488,7 +1606,7 @@ function symbolicDeterminant(m) {
|
|
|
1488
1606
|
let det = constNode(1);
|
|
1489
1607
|
for (let col = 0; col < n; col++) {
|
|
1490
1608
|
const pivot = simplifySymbolic(a[col][col]);
|
|
1491
|
-
if (pivot.kind === "const" && isRationalZero(pivot.value)) return
|
|
1609
|
+
if (pivot.kind === "const" && isRationalZero(pivot.value)) return chunk2TZKENDH_cjs.numberValue(0);
|
|
1492
1610
|
det = simplifySymbolic({ kind: "mul", left: det, right: pivot });
|
|
1493
1611
|
for (let r = col + 1; r < n; r++) {
|
|
1494
1612
|
const factor = simplifySymbolic({ kind: "div", left: a[r][col], right: pivot });
|
|
@@ -1497,11 +1615,11 @@ function symbolicDeterminant(m) {
|
|
|
1497
1615
|
}
|
|
1498
1616
|
}
|
|
1499
1617
|
}
|
|
1500
|
-
return det.kind === "const" ?
|
|
1618
|
+
return det.kind === "const" ? chunk2TZKENDH_cjs.numberValue(rationalToNumber(det.value)) : chunk2TZKENDH_cjs.symbolicValue(det);
|
|
1501
1619
|
}
|
|
1502
1620
|
function determinant(m) {
|
|
1503
1621
|
if (!isSquare(m)) {
|
|
1504
|
-
return
|
|
1622
|
+
return chunk2TZKENDH_cjs.errorValue("DETERMINANT_REQUIRES_SQUARE_MATRIX", `det: matrix must be square (got ${m.rows}x${m.cols}).`);
|
|
1505
1623
|
}
|
|
1506
1624
|
return m.hasSymbolic ? symbolicDeterminant(m) : numericDeterminant(m);
|
|
1507
1625
|
}
|
|
@@ -1521,7 +1639,7 @@ function numericInverse(m) {
|
|
|
1521
1639
|
}
|
|
1522
1640
|
}
|
|
1523
1641
|
if (maxAbs < 1e-10) {
|
|
1524
|
-
return
|
|
1642
|
+
return chunk2TZKENDH_cjs.errorValue("SINGULAR_MATRIX", `inv: a ${n}x${n} matrix with a zero (or near-zero) pivot column is not invertible.`);
|
|
1525
1643
|
}
|
|
1526
1644
|
if (pivotRow !== col) {
|
|
1527
1645
|
const tmp = a[col];
|
|
@@ -1541,13 +1659,13 @@ function numericInverse(m) {
|
|
|
1541
1659
|
for (let r = 0; r < n; r++) {
|
|
1542
1660
|
for (let c = 0; c < n; c++) data[r + c * n] = a[r][n + c];
|
|
1543
1661
|
}
|
|
1544
|
-
return
|
|
1662
|
+
return chunk2TZKENDH_cjs.matrixValue(n, n, data);
|
|
1545
1663
|
}
|
|
1546
1664
|
var SYMBOLIC_INVERSE_DIMENSION_LIMIT = 9;
|
|
1547
1665
|
function symbolicInverse(m) {
|
|
1548
1666
|
const n = m.rows;
|
|
1549
1667
|
if (n >= SYMBOLIC_INVERSE_DIMENSION_LIMIT) {
|
|
1550
|
-
return
|
|
1668
|
+
return chunk2TZKENDH_cjs.errorValue(
|
|
1551
1669
|
"SYMBOLIC_INVERSE_DIMENSION_LIMIT",
|
|
1552
1670
|
`Symbolic matrix inversion is limited to matrices smaller than ${SYMBOLIC_INVERSE_DIMENSION_LIMIT}x${SYMBOLIC_INVERSE_DIMENSION_LIMIT} (got ${n}x${n}).`
|
|
1553
1671
|
);
|
|
@@ -1562,7 +1680,7 @@ function symbolicInverse(m) {
|
|
|
1562
1680
|
for (let col = 0; col < n; col++) {
|
|
1563
1681
|
const pivot = simplifySymbolic(a[col][col]);
|
|
1564
1682
|
if (pivot.kind === "const" && isRationalZero(pivot.value)) {
|
|
1565
|
-
return
|
|
1683
|
+
return chunk2TZKENDH_cjs.errorValue(
|
|
1566
1684
|
"SYMBOLIC_SINGULAR_OR_UNSUPPORTED_PIVOT",
|
|
1567
1685
|
`Symbolic inverse: the pivot at row/col ${col} is exactly zero \u2014 this matrix's structure isn't invertible via this engine's diagonal-first symbolic elimination (no row-swapping); try reordering rows manually.`
|
|
1568
1686
|
);
|
|
@@ -1583,22 +1701,22 @@ function symbolicInverse(m) {
|
|
|
1583
1701
|
for (let r = 0; r < n; r++) {
|
|
1584
1702
|
for (let c = 0; c < n; c++) data[r + c * n] = symbolicToEntry(a[r][n + c]);
|
|
1585
1703
|
}
|
|
1586
|
-
return
|
|
1704
|
+
return chunk2TZKENDH_cjs.matrixValue(n, n, data);
|
|
1587
1705
|
}
|
|
1588
1706
|
function inverse(m) {
|
|
1589
1707
|
if (!isSquare(m)) {
|
|
1590
|
-
return
|
|
1708
|
+
return chunk2TZKENDH_cjs.errorValue("INVERSE_REQUIRES_SQUARE_MATRIX", `inv: matrix must be square (got ${m.rows}x${m.cols}).`);
|
|
1591
1709
|
}
|
|
1592
1710
|
return m.hasSymbolic ? symbolicInverse(m) : numericInverse(m);
|
|
1593
1711
|
}
|
|
1594
1712
|
function tooLarge(length, maxElements) {
|
|
1595
|
-
return
|
|
1713
|
+
return chunk2TZKENDH_cjs.errorValue(
|
|
1596
1714
|
"COLLECTION_TOO_LARGE",
|
|
1597
1715
|
`This collection has ${length} elements, past the limit of ${maxElements} (see the engine's vm.maxCollectionSize setting).`
|
|
1598
1716
|
);
|
|
1599
1717
|
}
|
|
1600
1718
|
function collectionToValues(v, maxElements = Number.POSITIVE_INFINITY) {
|
|
1601
|
-
const faulted =
|
|
1719
|
+
const faulted = chunk2TZKENDH_cjs.faultedOperand(v);
|
|
1602
1720
|
if (faulted) return faulted;
|
|
1603
1721
|
if (v.type === 7 /* Matrix */) {
|
|
1604
1722
|
const m = v.value;
|
|
@@ -1610,10 +1728,10 @@ function collectionToValues(v, maxElements = Number.POSITIVE_INFINITY) {
|
|
|
1610
1728
|
const length = r.max - r.min + 1;
|
|
1611
1729
|
if (length > maxElements) return tooLarge(length, maxElements);
|
|
1612
1730
|
const out = new Array(length);
|
|
1613
|
-
for (let i = 0; i < length; i++) out[i] =
|
|
1731
|
+
for (let i = 0; i < length; i++) out[i] = chunk2TZKENDH_cjs.numberValue(r.min + i);
|
|
1614
1732
|
return out;
|
|
1615
1733
|
}
|
|
1616
|
-
return
|
|
1734
|
+
return chunk2TZKENDH_cjs.errorValue(
|
|
1617
1735
|
"MAP_REDUCE_REQUIRES_COLLECTION",
|
|
1618
1736
|
`map/reduce requires a Matrix or Range collection (e.g. "[1,2,3]" or "0:3").`
|
|
1619
1737
|
);
|
|
@@ -1740,6 +1858,19 @@ exports.compareMonomials = compareMonomials;
|
|
|
1740
1858
|
exports.complex = complex;
|
|
1741
1859
|
exports.complexNode = complexNode;
|
|
1742
1860
|
exports.constNode = constNode;
|
|
1861
|
+
exports.decimalAdd = decimalAdd;
|
|
1862
|
+
exports.decimalCompare = decimalCompare;
|
|
1863
|
+
exports.decimalDivide = decimalDivide;
|
|
1864
|
+
exports.decimalFromInteger = decimalFromInteger;
|
|
1865
|
+
exports.decimalFromLiteral = decimalFromLiteral;
|
|
1866
|
+
exports.decimalFromNumberIfExact = decimalFromNumberIfExact;
|
|
1867
|
+
exports.decimalIsZero = decimalIsZero;
|
|
1868
|
+
exports.decimalMultiply = decimalMultiply;
|
|
1869
|
+
exports.decimalNegate = decimalNegate;
|
|
1870
|
+
exports.decimalRound = decimalRound;
|
|
1871
|
+
exports.decimalSubtract = decimalSubtract;
|
|
1872
|
+
exports.decimalToFixed = decimalToFixed;
|
|
1873
|
+
exports.decimalToNumber = decimalToNumber;
|
|
1743
1874
|
exports.determinant = determinant;
|
|
1744
1875
|
exports.exactIntegerCbrt = exactIntegerCbrt;
|
|
1745
1876
|
exports.exactIntegerSqrt = exactIntegerSqrt;
|
|
@@ -1766,6 +1897,7 @@ exports.polyDegree = polyDegree;
|
|
|
1766
1897
|
exports.polyUnivariateVar = polyUnivariateVar;
|
|
1767
1898
|
exports.polynomialDivide = polynomialDivide;
|
|
1768
1899
|
exports.powNode = powNode;
|
|
1900
|
+
exports.rational = rational;
|
|
1769
1901
|
exports.rationalAdd = rationalAdd;
|
|
1770
1902
|
exports.rationalCompare = rationalCompare;
|
|
1771
1903
|
exports.rationalDiv = rationalDiv;
|
|
@@ -1787,5 +1919,5 @@ exports.symbolicToEntry = symbolicToEntry;
|
|
|
1787
1919
|
exports.toPolynomial = toPolynomial;
|
|
1788
1920
|
exports.transpose = transpose;
|
|
1789
1921
|
exports.varNode = varNode;
|
|
1790
|
-
//# sourceMappingURL=chunk-
|
|
1791
|
-
//# sourceMappingURL=chunk-
|
|
1922
|
+
//# sourceMappingURL=chunk-HIQ5HSZL.cjs.map
|
|
1923
|
+
//# sourceMappingURL=chunk-HIQ5HSZL.cjs.map
|