@sheetxl/formulas-extended 0.8.0-beta.1 → 0.8.0-beta.2
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/browser/cjs/B4ANcw0mAmhe2Aeb.cjs +1 -0
- package/browser/cjs/B6IXpae7f0J8Ocq6.cjs +1 -0
- package/browser/cjs/Bncc0oXhFMdj_HuR.cjs +1 -0
- package/browser/cjs/C4cZxb9nRtzTCA40.cjs +1 -0
- package/browser/cjs/{lEQC21-Sk4lwHy2r.cjs → CFxueP0tbpmvY1Ip.cjs} +1 -1
- package/browser/cjs/CRcv32tHTbGSGtkh.cjs +1 -0
- package/browser/cjs/CaJGoNwTL6pAJ6a4.cjs +1 -0
- package/browser/cjs/CfXcRa4RlFmqU0Op.cjs +1 -0
- package/browser/cjs/{CnZfa45XxA-9Jhmp.cjs → DRmo6uoGoqtiVff8.cjs} +1 -1
- package/browser/cjs/DSXLVieENYN9qXYl.cjs +1 -0
- package/browser/cjs/DpFg69dDCPoOK2BY.cjs +1 -0
- package/browser/cjs/PmwvZPFhqmL4DO58.cjs +1 -0
- package/browser/cjs/SATfdSwNygvlOSKC.cjs +1 -0
- package/browser/cjs/XRCcogT-Iqd3Wv6R.cjs +1 -0
- package/browser/cjs/iYn00uzmSLl2T0oN.cjs +1 -0
- package/browser/cjs/index.cjs +1 -1
- package/browser/esm/{B1VmvhXuEn7zaTB9.mjs → B819DNjPdbTwz9F1.mjs} +1 -1
- package/{node/esm/COqdI1LYTHd9oLA6.mjs → browser/esm/BPDTXAH_YiFBVS9b.mjs} +1 -1
- package/{node/esm/DodhOXkSzelSxHmB.mjs → browser/esm/Bil0YAk5yZiRX2y1.mjs} +27 -29
- package/browser/esm/{DpoZ7h1ScIJvbOY9.mjs → Bsu4BOOlbAHpAp8R.mjs} +5 -5
- package/browser/esm/BtB39tHAccv8ITPI.mjs +119 -0
- package/{node/esm/srpVt74r2zbvm1N0.mjs → browser/esm/BxTcfN8h_FE-sbSK.mjs} +5 -5
- package/browser/esm/{BFnDPCjxJcoIItFa.mjs → C6Qt3r7mhw1LR02X.mjs} +3 -3
- package/browser/esm/C7p2YYAK6S2mN92V.mjs +19 -0
- package/browser/esm/CBsy5mA5btmVkbzR.mjs +32 -0
- package/{node/esm/BuGemmv84T8m0wqw.mjs → browser/esm/CIHlNxbWDUWI5fd8.mjs} +1 -1
- package/{node/esm/vu0NRDeeTbEHPMYS.mjs → browser/esm/CntAjIR6qmdYZXg0.mjs} +2 -2
- package/browser/esm/CpVnCV52v4qSBk79.mjs +33 -0
- package/browser/esm/D62u7Lj1Nd9ZM4Rp.mjs +58 -0
- package/{node/esm/CnVJ8GAsshRjRGA-.mjs → browser/esm/Dov9_ZXeOSh41yWn.mjs} +2 -2
- package/browser/esm/{DY3kG36QGyDbrANO.mjs → RHxlSf1j-K7Bdtwt.mjs} +1 -1
- package/browser/esm/YWvMccjlBVoxmNN_.mjs +47 -0
- package/browser/esm/_cE9OKmzmk6MyRKQ.mjs +37 -0
- package/browser/esm/index.mjs +3283 -1677
- package/browser/esm/r21pRf-kqnnAD611.mjs +32 -0
- package/{node/esm/BRwwvGaJ6HvkxjFC.mjs → browser/esm/v2vXc6oQz1MG0L1T.mjs} +1 -1
- package/{node/esm/Bma3CN4_Nec6_4n7.mjs → browser/esm/vMGzN0Xt0WnzZiH5.mjs} +6 -6
- package/node/esm/{B1VmvhXuEn7zaTB9.mjs → B819DNjPdbTwz9F1.mjs} +1 -1
- package/{browser/esm/COqdI1LYTHd9oLA6.mjs → node/esm/BPDTXAH_YiFBVS9b.mjs} +1 -1
- package/{browser/esm/DodhOXkSzelSxHmB.mjs → node/esm/Bil0YAk5yZiRX2y1.mjs} +27 -29
- package/node/esm/{DpoZ7h1ScIJvbOY9.mjs → Bsu4BOOlbAHpAp8R.mjs} +5 -5
- package/node/esm/BtB39tHAccv8ITPI.mjs +119 -0
- package/{browser/esm/srpVt74r2zbvm1N0.mjs → node/esm/BxTcfN8h_FE-sbSK.mjs} +5 -5
- package/node/esm/CBsy5mA5btmVkbzR.mjs +32 -0
- package/{browser/esm/BuGemmv84T8m0wqw.mjs → node/esm/CIHlNxbWDUWI5fd8.mjs} +1 -1
- package/{browser/esm/vu0NRDeeTbEHPMYS.mjs → node/esm/CntAjIR6qmdYZXg0.mjs} +2 -2
- package/node/esm/CpVnCV52v4qSBk79.mjs +33 -0
- package/node/esm/D62u7Lj1Nd9ZM4Rp.mjs +58 -0
- package/{browser/esm/CnVJ8GAsshRjRGA-.mjs → node/esm/Dov9_ZXeOSh41yWn.mjs} +2 -2
- package/node/esm/{BQyZVLTMNFLbjVap.mjs → LF8AasftSZOpXqHe.mjs} +3 -3
- package/node/esm/YWvMccjlBVoxmNN_.mjs +47 -0
- package/node/esm/YzY_Aik1Q_7Ay4JY.mjs +19 -0
- package/node/esm/_cE9OKmzmk6MyRKQ.mjs +37 -0
- package/node/esm/index.mjs +3607 -1998
- package/node/esm/r21pRf-kqnnAD611.mjs +32 -0
- package/node/esm/{LAkTk93odAfpvx50.mjs → sXWR_bAqmw8b4bT6.mjs} +1 -1
- package/{browser/esm/BRwwvGaJ6HvkxjFC.mjs → node/esm/v2vXc6oQz1MG0L1T.mjs} +1 -1
- package/{browser/esm/Bma3CN4_Nec6_4n7.mjs → node/esm/vMGzN0Xt0WnzZiH5.mjs} +6 -6
- package/package.json +3 -3
- package/types/src/.generated/decl/financial/Annuity.decl.d.ts +5 -0
- package/types/src/.generated/decl/financial/{Financial.decl.d.ts → Cashflow.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/Convert.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/Coupon.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/{Financial2.decl.d.ts → Depreciation.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/Growth.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/{ODD.decl.d.ts → Odd.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/{Financial3.decl.d.ts → STOCKHISTORY.decl.d.ts} +1 -1
- package/types/src/.generated/decl/financial/Security.decl.d.ts +4 -0
- package/types/src/.generated/decl/financial/{Financial4.decl.d.ts → SecurityMaturity.decl.d.ts} +1 -1
- package/types/src/.generated/decl/{statistical/TTEST.decl.d.ts → financial/TBill.decl.d.ts} +1 -1
- package/types/src/.generated/decl/statistical/{ETS.decl.d.ts → Ets.decl.d.ts} +1 -1
- package/types/src/.generated/decl/statistical/TTest.decl.d.ts +4 -0
- package/types/src/.generated/desc/financial/Annuity.desc.d.ts +5 -0
- package/types/src/.generated/desc/financial/{Financial.desc.d.ts → Cashflow.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/Convert.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/Coupon.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/{Financial2.desc.d.ts → Depreciation.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/Growth.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/{ODD.desc.d.ts → Odd.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/{Financial3.desc.d.ts → STOCKHISTORY.desc.d.ts} +1 -1
- package/types/src/.generated/desc/financial/Security.desc.d.ts +4 -0
- package/types/src/.generated/desc/financial/{Financial4.desc.d.ts → SecurityMaturity.desc.d.ts} +1 -1
- package/types/src/.generated/desc/{statistical/TTEST.desc.d.ts → financial/TBill.desc.d.ts} +1 -1
- package/types/src/.generated/desc/statistical/{ETS.desc.d.ts → Ets.desc.d.ts} +1 -1
- package/types/src/.generated/desc/statistical/TTest.desc.d.ts +4 -0
- package/types/src/_utils/AnyArgs.d.ts +17 -3
- package/types/src/_utils/FinanaceSolver.d.ts +39 -2
- package/types/src/_utils/FinanceAmor.d.ts +23 -0
- package/types/src/_utils/FinanceCashflow.d.ts +42 -0
- package/types/src/_utils/FinanceCoupon.d.ts +92 -82
- package/types/src/_utils/FinanceDate.d.ts +24 -0
- package/types/src/_utils/FinanceDayCount.d.ts +46 -0
- package/types/src/_utils/FinanceOdd.d.ts +93 -0
- package/types/src/_utils/FinanceSecurity.d.ts +84 -0
- package/types/src/_utils/FinanceUtils.d.ts +34 -0
- package/types/src/_utils/LeastSquares.d.ts +20 -22
- package/types/src/_utils/RegexCompile.d.ts +33 -0
- package/types/src/cube/Cube.d.ts +7 -7
- package/types/src/financial/ACCRINT.d.ts +33 -6
- package/types/src/financial/AMORDEGRC.d.ts +22 -40
- package/types/src/financial/Annuity.d.ts +118 -0
- package/types/src/financial/Cashflow.d.ts +84 -0
- package/types/src/financial/Convert.d.ts +26 -0
- package/types/src/financial/Coupon.d.ts +72 -0
- package/types/src/financial/Date.d.ts +34 -5
- package/types/src/financial/Depreciation.d.ts +58 -0
- package/types/src/financial/Growth.d.ts +22 -0
- package/types/src/financial/Odd.d.ts +82 -0
- package/types/src/financial/STOCKHISTORY.d.ts +17 -0
- package/types/src/financial/Security.d.ts +68 -0
- package/types/src/financial/SecurityMaturity.d.ts +107 -0
- package/types/src/financial/TBill.d.ts +40 -0
- package/types/src/financial/VDB.d.ts +15 -13
- package/types/src/statistical/{ETS.d.ts → Ets.d.ts} +14 -14
- package/types/src/statistical/Regression.d.ts +13 -18
- package/types/src/statistical/{TTEST.d.ts → TTest.d.ts} +5 -5
- package/types/src/text/RegEx.d.ts +34 -11
- package/browser/cjs/B4JJfKSI4ppwU855.cjs +0 -1
- package/browser/cjs/BwLx9ix5Sq7suAYP.cjs +0 -1
- package/browser/cjs/Clu7XiAsCB48GDXN.cjs +0 -1
- package/browser/cjs/DsFZgtSQpC75d1M0.cjs +0 -1
- package/browser/cjs/fqTQ_p3ehzUvc1tF.cjs +0 -1
- package/browser/cjs/h3dw1jAp2J5Pu4p3.cjs +0 -1
- package/browser/cjs/jev6VGWTdgEgm4Yk.cjs +0 -1
- package/browser/esm/CwoMEzOtRihuYUTr.mjs +0 -20
- package/browser/esm/Dy6UD7hQRBsT0WNp.mjs +0 -304
- package/node/esm/CwoMEzOtRihuYUTr.mjs +0 -20
- package/node/esm/Dy6UD7hQRBsT0WNp.mjs +0 -304
- package/types/src/financial/Financial.d.ts +0 -288
- package/types/src/financial/Financial2.d.ts +0 -99
- package/types/src/financial/Financial3.d.ts +0 -95
- package/types/src/financial/Financial4.d.ts +0 -82
- package/types/src/financial/ODD.d.ts +0 -106
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.2
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
var e = {
|
|
8
|
+
FVSCHEDULE: {
|
|
9
|
+
s: "Returns the future value of an initial principal after applying a series of compound interest rates.",
|
|
10
|
+
p: {
|
|
11
|
+
principal: { d: "is the present value." },
|
|
12
|
+
schedule: { d: "is an array of interest rates to apply." }
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
RRI: {
|
|
16
|
+
s: "Returns an equivalent interest rate for the growth of an investment.",
|
|
17
|
+
p: {
|
|
18
|
+
nper: { d: "is the total number of payment periods." },
|
|
19
|
+
pv: { d: "is the present value of the investment." },
|
|
20
|
+
fv: { d: "is the future value of the investment." }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
PDURATION: {
|
|
24
|
+
s: "Returns the number of periods required by an investment to reach a specified value.",
|
|
25
|
+
p: {
|
|
26
|
+
rate: { d: "is the interest rate." },
|
|
27
|
+
pv: { d: "is the present value of the investment." },
|
|
28
|
+
fv: { d: "is the desired future value of the investment." }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export { e as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.2
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.2
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/formulas-extended - Formulas Enterprise - TypeScript formulas compatible with Excel built-ins. - v0.8.0-beta.2
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -17,10 +17,10 @@ var e = {
|
|
|
17
17
|
COUPDAYS: {
|
|
18
18
|
s: "Returns the number of days in the coupon period containing the settlement date.",
|
|
19
19
|
p: {
|
|
20
|
-
settlement: { d: "
|
|
21
|
-
maturity: { d: "
|
|
22
|
-
frequency: { d: "
|
|
23
|
-
basis: { d: "
|
|
20
|
+
settlement: { d: "is the security's settlement date, expressed as a serial date number." },
|
|
21
|
+
maturity: { d: "is the security's maturity date, expressed as a serial date number." },
|
|
22
|
+
frequency: { d: "is the number of coupon payments per year." },
|
|
23
|
+
basis: { d: "is the type of day count basis to use." }
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
COUPDAYSNC: {
|
|
@@ -33,7 +33,7 @@ var e = {
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
COUPNCD: {
|
|
36
|
-
s: "Returns the
|
|
36
|
+
s: "Returns the next coupon date after the settlement date.",
|
|
37
37
|
p: {
|
|
38
38
|
settlement: { d: "is the security's settlement date, expressed as a serial date number." },
|
|
39
39
|
maturity: { d: "is the security's maturity date, expressed as a serial date number." },
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/formulas-extended",
|
|
3
3
|
"description": "Formulas Enterprise - TypeScript formulas compatible with Excel built-ins.",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.2",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"formulas"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@sheetxl/primitives": "^0.8.0-beta.
|
|
41
|
-
"@sheetxl/scripting": "^0.8.0-beta.
|
|
40
|
+
"@sheetxl/primitives": "^0.8.0-beta.2",
|
|
41
|
+
"@sheetxl/scripting": "^0.8.0-beta.2"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Scalar } from '@sheetxl/primitives';
|
|
1
|
+
import { Scalar, Omittable } from '@sheetxl/primitives';
|
|
2
2
|
/**
|
|
3
3
|
* Readers for arguments Excel declares `any` rather than `number`.
|
|
4
4
|
*
|
|
@@ -23,10 +23,17 @@ import { Scalar } from '@sheetxl/primitives';
|
|
|
23
23
|
* `parseAsSerialDate` supplies the refusal — `#VALUE!` for a boolean, whether it arrived as a
|
|
24
24
|
* literal or as a cell, and an incoming error rethrown with its own identity.
|
|
25
25
|
*
|
|
26
|
-
* A blank CELL is serial 0.
|
|
27
|
-
*
|
|
26
|
+
* A blank CELL is serial 0. A genuinely empty SLOT is `#N/A` in Excel (`EOMONTH(,0)`,
|
|
27
|
+
* `YEARFRAC(,39814)` — fn-battery financial/YEARFRAC, 2026-08-28); a parameter declared
|
|
28
|
+
* `Omittable<Scalar>` sees that slot as `undefined` and reads it through {@link anyDateRequired}.
|
|
28
29
|
*/
|
|
29
30
|
export declare function anyDate(value: Scalar): number;
|
|
31
|
+
/**
|
|
32
|
+
* A REQUIRED date parameter Excel declares `any` (`Omittable<Scalar>` on the declaration): an
|
|
33
|
+
* argument supplied EMPTY is a missing argument (#N/A); everything else reads through
|
|
34
|
+
* {@link anyDate}, so a blank CELL is still serial 0.
|
|
35
|
+
*/
|
|
36
|
+
export declare function anyDateRequired(value: Omittable<Scalar>): number;
|
|
30
37
|
/**
|
|
31
38
|
* Reads a plain NUMERIC argument declared `any` — the `months`/`basis` slots.
|
|
32
39
|
*
|
|
@@ -35,4 +42,11 @@ export declare function anyDate(value: Scalar): number;
|
|
|
35
42
|
* text parsed, boolean refused, error identity preserved.
|
|
36
43
|
*/
|
|
37
44
|
export declare function anyNumber(value: Scalar): number;
|
|
45
|
+
/**
|
|
46
|
+
* A REQUIRED parameter Excel declares `any` (`Omittable<Scalar>` on the declaration): an argument
|
|
47
|
+
* supplied EMPTY is a missing argument (#N/A) rather than a zero, and everything else reads
|
|
48
|
+
* through `anyNumber`. The `undefined` check must come first — `anyNumber` reads a blank cell's
|
|
49
|
+
* `null` as 0, which is what a blank CELL is measured to be.
|
|
50
|
+
*/
|
|
51
|
+
export declare function anyRequired(value: Omittable<Scalar>): number;
|
|
38
52
|
//# sourceMappingURL=AnyArgs.d.ts.map
|
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
type IterFn = (x: number) => number;
|
|
2
|
+
/**
|
|
3
|
+
* The approximate yield a bond-yield iteration starts from: the annual coupon plus the pull to par
|
|
4
|
+
* spread over `years`, against a denominator that is the mid-point of par and the price less a
|
|
5
|
+
* `years`-scaled share of the same pull. At par it returns the coupon rate exactly, which is why
|
|
6
|
+
* a bond priced at 100 answers in one step.
|
|
7
|
+
*
|
|
8
|
+
* `years` is {@link getYearsToMaturity}, never the coupon count over the frequency. Measured on
|
|
9
|
+
* 1,154 rows of fn-battery financial/adhoc-yield-start, -n, -n2 and -n3 — bonds whose redemption
|
|
10
|
+
* dwarfs the price, where a hundred Newton steps carry the start out to a number that inverts.
|
|
11
|
+
*
|
|
12
|
+
* Used by: YIELD, ODDFYIELD.
|
|
13
|
+
*/
|
|
14
|
+
export declare function approximateYield(rate: number, pr: number, years: number): number;
|
|
15
|
+
/**
|
|
16
|
+
* Excel's bond-yield iteration: Newton on the price with its ANALYTIC slope, at most a hundred
|
|
17
|
+
* steps from {@link approximateYield}, stopping the first time a step moves the yield by less than
|
|
18
|
+
* `1e-5` and answering the iterate the step just produced — so the answer is a PARTIALLY converged
|
|
19
|
+
* one, ~1e-10 from the root on an ordinary bond, and on a bond that cannot converge it is simply
|
|
20
|
+
* where the walk stood after a hundred steps.
|
|
21
|
+
*
|
|
22
|
+
* A slope that overflows to infinity, or a step that lands where the price cannot be evaluated
|
|
23
|
+
* (a `1 + y/f` at or below zero), is `NaN` — the caller's #NUM!.
|
|
24
|
+
*
|
|
25
|
+
* Measured on YIELD's 1,134-row battery and fn-battery financial/adhoc-yield-fingerprint,
|
|
26
|
+
* -start, -n, -n2, -n3, -domain (2026-09-09).
|
|
27
|
+
*
|
|
28
|
+
* Used by: YIELD, ODDFYIELD.
|
|
29
|
+
*/
|
|
30
|
+
export declare function solveYieldByNewton(start: number, priceFn: IterFn, slopeFn: IterFn): number;
|
|
31
|
+
export {};
|
|
2
32
|
/**
|
|
3
33
|
* Solve `iterFn(x) = 0` numerically, starting from `guess`.
|
|
4
34
|
*
|
|
@@ -14,6 +44,13 @@ type IterFn = (x: number) => number;
|
|
|
14
44
|
*
|
|
15
45
|
* Used by: YIELD, ODDFYIELD, ODDLYIELD.
|
|
16
46
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Bisection fallback when Newton-Raphson fails to converge.
|
|
49
|
+
*
|
|
50
|
+
* Phase 1: Expand a small bracket around guess until the function changes sign
|
|
51
|
+
* (guarantees a root is bracketed, or gives up with NaN).
|
|
52
|
+
* Phase 2: Standard bisection to isolate the root.
|
|
53
|
+
*
|
|
54
|
+
* Returns NaN if no bracket is found within the iteration budget.
|
|
55
|
+
*/
|
|
19
56
|
//# sourceMappingURL=FinanaceSolver.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Scalar, Omittable } from '@sheetxl/primitives';
|
|
2
|
+
/** The arguments of AMORLINC/AMORDEGRC once read and validated. */
|
|
3
|
+
export interface AmorArgs {
|
|
4
|
+
cost: number;
|
|
5
|
+
salvage: number;
|
|
6
|
+
/** The period as Excel indexes it: under 1 is period 1, above 1 truncates. */
|
|
7
|
+
periodIndex: number;
|
|
8
|
+
rate: number;
|
|
9
|
+
/** The stub period's day count (`getAmorDayCount`); its year fraction is `days / yearDays`. */
|
|
10
|
+
days: number;
|
|
11
|
+
yearDays: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The seven arguments of AMORLINC/AMORDEGRC — measured against Excel 16.0 (fn-battery
|
|
15
|
+
* financial/AMORLINC, /AMORDEGRC, 2026-08-28). Every one is Excel-declared `any`, so they are
|
|
16
|
+
* read here in declaration order, with the basis read AFTER the dates are validated (a reversed
|
|
17
|
+
* date pair beats a text basis: `…, DATE(2008,12,31), DATE(2008,8,19), …, "x")` is #NUM!). The
|
|
18
|
+
* serials truncate; the shared domain is `cost > 0`, `0 ≤ salvage ≤ cost`, `period ≥ 0`,
|
|
19
|
+
* `rate > 0`, both dates in the calendar and in order, and a truncated basis of 0, 1, 3 or 4.
|
|
20
|
+
* Returns `null` for #NUM!.
|
|
21
|
+
*/
|
|
22
|
+
export declare function amorArgs(cost: Omittable<Scalar>, datePurchased: Omittable<Scalar>, firstPeriod: Omittable<Scalar>, salvage: Omittable<Scalar>, period: Omittable<Scalar>, rate: Omittable<Scalar>, basis: Omittable<Scalar>): AmorArgs | null;
|
|
23
|
+
//# sourceMappingURL=FinanceAmor.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { IRange } from '@sheetxl/primitives';
|
|
2
|
+
/**
|
|
3
|
+
* The dated cash-flow operands of XNPV and XIRR, read the way Excel reads them (measured against
|
|
4
|
+
* Excel 16.0, fn-battery financial/XNPV, 2026-08-29).
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Both functions take two operands that are read TOGETHER, member by member, by flattened
|
|
8
|
+
* row-major ordinal — a 3x1 pairs fully with a 1x3 and a 2x2 pairs with a 4x1
|
|
9
|
+
* (DESIGN-RANGE-PAIRING). That makes the reading order a pair scan rather than a slot order, and
|
|
10
|
+
* it is one pass that stops at the first fault: a bad ordinal 2 is answered before ordinal 3's
|
|
11
|
+
* error is looked at.
|
|
12
|
+
*
|
|
13
|
+
* Ordinal 0 is not like the rest. Its DATE is read before its value (an error there wins over an
|
|
14
|
+
* error in the first flow) and range-checked before either, and a member of EITHER operand that
|
|
15
|
+
* is not a number is `#VALUE!` there where the same member at any later ordinal is `#NUM!` —
|
|
16
|
+
* so a whole operand of numeric text, or of blanks, answers `#VALUE!` while one number among
|
|
17
|
+
* them answers `#NUM!`.
|
|
18
|
+
*/
|
|
19
|
+
export interface DatedFlows {
|
|
20
|
+
/** The flow at each ordinal. */
|
|
21
|
+
values: number[];
|
|
22
|
+
/** Days from the first date, every serial truncated first. */
|
|
23
|
+
days: number[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* `(values, dates)` as XNPV and XIRR read them. `valuesSlot` is the argument index of the values
|
|
27
|
+
* operand (the dates operand is the next one), which is what tells a one-cell operand from a list
|
|
28
|
+
* of one; `dialect` picks between the two functions' member rules.
|
|
29
|
+
*
|
|
30
|
+
* The pair scan is common to both: a count mismatch is `#NUM!` before anything else, and then, per
|
|
31
|
+
* ordinal, an error in the values operand, an error in the dates operand, and only then the kinds
|
|
32
|
+
* and the date's own domain.
|
|
33
|
+
*
|
|
34
|
+
* What differs is what a member may BE. XNPV's list members must already be numbers — a text, a
|
|
35
|
+
* boolean, an empty string or a blank is `#VALUE!` at ordinal 0 and `#NUM!` after it — and its
|
|
36
|
+
* serials run `[1, MAX_SERIAL_DATE]` with every date at or after the first. XIRR COERCES its
|
|
37
|
+
* members instead (numeric text and date text parse, a boolean or a true text is `#VALUE!`
|
|
38
|
+
* wherever it sits), drops a pair whose VALUE is blank, answers `#NUM!` for a blank DATE beside a
|
|
39
|
+
* present value, admits serial 0, and does not order the dates at all.
|
|
40
|
+
*/
|
|
41
|
+
export declare function readDatedFlows(values: IRange, dates: IRange, valuesSlot: number, dialect?: 'xnpv' | 'xirr'): DatedFlows;
|
|
42
|
+
//# sourceMappingURL=FinanceCashflow.d.ts.map
|