@sheetxl/formulas-extended 0.8.0-beta.9 → 1.0.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/LICENSE.md +8 -7
- package/{node/esm/JkQSWLNPCu_8g4l-.mjs → browser/esm/A_TsslEa7v06xjtB.mjs} +2 -2
- package/browser/esm/{5sQ_DXl0MrRTUIW3.mjs → BPrqhbN9VZIYH5IG.mjs} +2 -2
- package/browser/esm/{DQWJ4nhgSo5a4BB3.mjs → BX7pY29hJOOcSicD.mjs} +2 -2
- package/{node/esm/Bu-j1WZUtXmQiMyw.mjs → browser/esm/B_36M25P3ylEdEr6.mjs} +2 -2
- package/browser/esm/{BwXSyxTdo33P8SR0.mjs → BgUzQFjcZdMSId1y.mjs} +2 -2
- package/browser/esm/{DZ1j0ict6yB_hn5_.mjs → BlZf6nKQmGZNKGWp.mjs} +2 -2
- package/browser/esm/{zV5brflSgLAzJ6hN.mjs → CB3MxWkCO8s1fDvl.mjs} +2 -2
- package/{node/esm/DChBrhWskfpYYcO-.mjs → browser/esm/CFEq5pyJzSfZaoNv.mjs} +2 -2
- package/browser/esm/{DCNAaAI6sQNbHYYG.mjs → Cg4mj9E_lfI_22Z_.mjs} +2 -2
- package/browser/esm/{KyWoSftzyePfPAWF.mjs → Cjdgx08VY9pwovrP.mjs} +2 -2
- package/{node/esm/C6YcHeXOlqNj92yr.mjs → browser/esm/D94bkwEKYwg5aljj.mjs} +2 -2
- package/{node/esm/KIHgbvLOTP8jZ_9A.mjs → browser/esm/DM-Vn8I-pbGcVFyb.mjs} +2 -2
- package/browser/esm/{BWh3GEPRlhyY-DMD.mjs → DMa57ep8SfoPew0E.mjs} +2 -2
- package/browser/esm/DQxba5bZ4GUDUbpv.mjs +23 -0
- package/browser/esm/{98BULtwEEGuWw6V-.mjs → DUHkfVtd_39bcscn.mjs} +2 -2
- package/browser/esm/{BRoxaRjj3YNgdjYi.mjs → DUWw2JsfQame7osY.mjs} +2 -2
- package/browser/esm/DwQaS7NDRKur9Yqv.mjs +2420 -0
- package/browser/esm/{BRgVxL9N9LgQqZta.mjs → L1F-cVvVuDRa5kZU.mjs} +2 -2
- package/{node/esm/DK1OoxPKMyYoxNY4.mjs → browser/esm/TR3__i4vpBI4hqi5.mjs} +2 -2
- package/browser/esm/{DWshlA_doHnluy5O.mjs → _6lBSpGAoGq4yAUk.mjs} +2 -2
- package/browser/esm/declarations.mjs +95 -0
- package/browser/esm/gCkKqa2flUEQZfwB.mjs +20 -0
- package/{node/esm/wznyhrP9TXtWfNcx.mjs → browser/esm/ibC1iRcve0_oOLNg.mjs} +2 -2
- package/browser/esm/index.mjs +1727 -3684
- package/{browser/esm/JkQSWLNPCu_8g4l-.mjs → node/esm/A_TsslEa7v06xjtB.mjs} +2 -2
- package/node/esm/{emJsUu0uBvJU9JcR.mjs → B-_ofzbDoQPe79St.mjs} +2 -2
- package/node/esm/{5sQ_DXl0MrRTUIW3.mjs → BPrqhbN9VZIYH5IG.mjs} +2 -2
- package/node/esm/{DQWJ4nhgSo5a4BB3.mjs → BX7pY29hJOOcSicD.mjs} +2 -2
- package/{browser/esm/Bu-j1WZUtXmQiMyw.mjs → node/esm/B_36M25P3ylEdEr6.mjs} +2 -2
- package/node/esm/{BwXSyxTdo33P8SR0.mjs → BgUzQFjcZdMSId1y.mjs} +2 -2
- package/node/esm/{DZ1j0ict6yB_hn5_.mjs → BlZf6nKQmGZNKGWp.mjs} +2 -2
- package/node/esm/{B3elbzi3D9XjQ1m-.mjs → C3K4PUymtn22TF3B.mjs} +2 -2
- package/node/esm/{zV5brflSgLAzJ6hN.mjs → CB3MxWkCO8s1fDvl.mjs} +2 -2
- package/{browser/esm/DChBrhWskfpYYcO-.mjs → node/esm/CFEq5pyJzSfZaoNv.mjs} +2 -2
- package/node/esm/{DCNAaAI6sQNbHYYG.mjs → Cg4mj9E_lfI_22Z_.mjs} +2 -2
- package/node/esm/{KyWoSftzyePfPAWF.mjs → Cjdgx08VY9pwovrP.mjs} +2 -2
- package/{browser/esm/C6YcHeXOlqNj92yr.mjs → node/esm/D94bkwEKYwg5aljj.mjs} +2 -2
- package/{browser/esm/KIHgbvLOTP8jZ_9A.mjs → node/esm/DM-Vn8I-pbGcVFyb.mjs} +2 -2
- package/node/esm/DQxba5bZ4GUDUbpv.mjs +23 -0
- package/node/esm/{BRoxaRjj3YNgdjYi.mjs → DUWw2JsfQame7osY.mjs} +2 -2
- package/node/esm/{BRgVxL9N9LgQqZta.mjs → L1F-cVvVuDRa5kZU.mjs} +2 -2
- package/{browser/esm/DK1OoxPKMyYoxNY4.mjs → node/esm/TR3__i4vpBI4hqi5.mjs} +2 -2
- package/node/esm/{DWshlA_doHnluy5O.mjs → _6lBSpGAoGq4yAUk.mjs} +2 -2
- package/node/esm/declarations.mjs +95 -0
- package/node/esm/gCkKqa2flUEQZfwB.mjs +20 -0
- package/{browser/esm/wznyhrP9TXtWfNcx.mjs → node/esm/ibC1iRcve0_oOLNg.mjs} +2 -2
- package/node/esm/index.mjs +2036 -3980
- package/node/esm/qwfjBY_rcYIzxR0p.mjs +2420 -0
- package/package.json +12 -7
- package/types/declarations.d.ts +4 -0
- package/types/src/.generated/decl/{financial/STOCKHISTORY.decl.d.ts → lookupReference/GroupBy.decl.d.ts} +1 -1
- package/types/src/.generated/decl/lookupReference/PivotBy.decl.d.ts +4 -0
- package/types/src/.generated/declarations.d.ts +7 -0
- package/types/src/.generated/desc/{financial/STOCKHISTORY.desc.d.ts → lookupReference/GroupBy.desc.d.ts} +1 -1
- package/types/src/.generated/desc/lookupReference/PivotBy.desc.d.ts +4 -0
- package/types/src/_utils/AnyArgs.d.ts +0 -12
- package/types/src/_utils/FinanaceSolver.d.ts +0 -27
- package/types/src/_utils/FinanceAmor.d.ts +0 -9
- package/types/src/_utils/FinanceCashflow.d.ts +0 -17
- package/types/src/_utils/FinanceCoupon.d.ts +0 -63
- package/types/src/_utils/FinanceDate.d.ts +0 -7
- package/types/src/_utils/FinanceDayCount.d.ts +0 -74
- package/types/src/_utils/FinanceOdd.d.ts +0 -62
- package/types/src/_utils/FinanceSecurity.d.ts +0 -21
- package/types/src/_utils/FinanceUtils.d.ts +0 -32
- package/types/src/_utils/Pivot.d.ts +203 -0
- package/types/src/cube/Cube.d.ts +7 -7
- package/types/src/financial/ACCRINT.d.ts +0 -23
- package/types/src/financial/AMORDEGRC.d.ts +0 -22
- package/types/src/financial/Cashflow.d.ts +0 -49
- package/types/src/financial/Coupon.d.ts +0 -14
- package/types/src/financial/Date.d.ts +0 -29
- package/types/src/financial/Depreciation.d.ts +0 -9
- package/types/src/financial/Odd.d.ts +0 -18
- package/types/src/financial/Security.d.ts +0 -10
- package/types/src/financial/SecurityMaturity.d.ts +0 -40
- package/types/src/financial/TBill.d.ts +0 -17
- package/types/src/financial/VDB.d.ts +0 -17
- package/types/src/lookupReference/GroupBy.d.ts +14 -0
- package/types/src/lookupReference/PivotBy.d.ts +17 -0
- package/browser/cjs/B4ANcw0mAmhe2Aeb.cjs +0 -1
- package/browser/cjs/B6IXpae7f0J8Ocq6.cjs +0 -1
- package/browser/cjs/BWDfauDHqB6U_2ka.cjs +0 -1
- package/browser/cjs/Bncc0oXhFMdj_HuR.cjs +0 -1
- package/browser/cjs/C2uDl8VIJqh58YF_.cjs +0 -1
- package/browser/cjs/C4cZxb9nRtzTCA40.cjs +0 -1
- package/browser/cjs/CFxueP0tbpmvY1Ip.cjs +0 -1
- package/browser/cjs/CRcv32tHTbGSGtkh.cjs +0 -1
- package/browser/cjs/CW-b31_-r-_raT8Y.cjs +0 -1
- package/browser/cjs/CaJGoNwTL6pAJ6a4.cjs +0 -1
- package/browser/cjs/CfXcRa4RlFmqU0Op.cjs +0 -1
- package/browser/cjs/DRmo6uoGoqtiVff8.cjs +0 -1
- package/browser/cjs/DSXLVieENYN9qXYl.cjs +0 -1
- package/browser/cjs/DpFg69dDCPoOK2BY.cjs +0 -1
- package/browser/cjs/JfM6P_qoQQTWakZf.cjs +0 -1
- package/browser/cjs/PmwvZPFhqmL4DO58.cjs +0 -1
- package/browser/cjs/SATfdSwNygvlOSKC.cjs +0 -1
- package/browser/cjs/XRCcogT-Iqd3Wv6R.cjs +0 -1
- package/browser/cjs/bM25C5avKgBAJVfk.cjs +0 -1
- package/browser/cjs/iYn00uzmSLl2T0oN.cjs +0 -1
- package/browser/cjs/index.cjs +0 -1
- package/browser/esm/DHe6x9JWC6WVrycM.mjs +0 -19
- package/node/esm/LuHET04W0CAIvpFU.mjs +0 -19
- package/types/src/financial/STOCKHISTORY.d.ts +0 -17
package/package.json
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/formulas-extended",
|
|
3
3
|
"description": "Formulas Enterprise - TypeScript formulas compatible with Excel built-ins.",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"license": "SEE LICENSE IN
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./types/index.d.ts",
|
|
10
10
|
"browser": "./browser/esm/index.mjs",
|
|
11
11
|
"node": "./node/esm/index.mjs",
|
|
12
|
-
"
|
|
13
|
-
|
|
12
|
+
"default": "./browser/esm/index.mjs"
|
|
13
|
+
},
|
|
14
|
+
"./declarations": {
|
|
15
|
+
"types": "./types/declarations.d.ts",
|
|
16
|
+
"browser": "./browser/esm/declarations.mjs",
|
|
17
|
+
"node": "./node/esm/declarations.mjs",
|
|
18
|
+
"default": "./browser/esm/declarations.mjs"
|
|
14
19
|
}
|
|
15
20
|
},
|
|
16
21
|
"types": "./types/index.d.ts",
|
|
17
22
|
"module": "./browser/esm/index.mjs",
|
|
18
|
-
"main": "./browser/
|
|
23
|
+
"main": "./browser/esm/index.mjs",
|
|
19
24
|
"sideEffects": false,
|
|
20
25
|
"engineStrict": true,
|
|
21
26
|
"homepage": "https://sheetxl.com",
|
|
@@ -37,7 +42,7 @@
|
|
|
37
42
|
"formulas"
|
|
38
43
|
],
|
|
39
44
|
"dependencies": {
|
|
40
|
-
"@sheetxl/primitives": "^0.
|
|
41
|
-
"@sheetxl/scripting": "^0.
|
|
45
|
+
"@sheetxl/primitives": "^1.0.0",
|
|
46
|
+
"@sheetxl/scripting": "^1.0.0"
|
|
42
47
|
}
|
|
43
48
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FunctionDeclarationModule } from '@sheetxl/scripting';
|
|
2
|
+
/**
|
|
3
|
+
* This package's declarations, one entry per source module, in binding order.
|
|
4
|
+
*/
|
|
5
|
+
declare const declarations: readonly FunctionDeclarationModule[];
|
|
6
|
+
export default declarations;
|
|
7
|
+
//# sourceMappingURL=declarations.d.ts.map
|
|
@@ -15,18 +15,6 @@ import { Scalar, Omittable } from '@sheetxl/primitives';
|
|
|
15
15
|
* This package does not depend on that one, so the rule is duplicated rather than imported;
|
|
16
16
|
* change both together.
|
|
17
17
|
*/
|
|
18
|
-
/**
|
|
19
|
-
* Reads a DATE argument declared `any`.
|
|
20
|
-
*
|
|
21
|
-
* Text is accepted in two steps, as `WEEKNUM` does it: numeric text is a SERIAL
|
|
22
|
-
* (`EOMONTH("36556",0)` = 36556) and only non-numeric text goes to the date parser.
|
|
23
|
-
* `parseAsSerialDate` supplies the refusal — `#VALUE!` for a boolean, whether it arrived as a
|
|
24
|
-
* literal or as a cell, and an incoming error rethrown with its own identity.
|
|
25
|
-
*
|
|
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}.
|
|
29
|
-
*/
|
|
30
18
|
export declare function anyDate(value: Scalar): number;
|
|
31
19
|
/**
|
|
32
20
|
* A REQUIRED date parameter Excel declares `any` (`Omittable<Scalar>` on the declaration): an
|
|
@@ -1,32 +1,5 @@
|
|
|
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
2
|
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
3
|
export declare function solveYieldByNewton(start: number, priceFn: IterFn, slopeFn: IterFn): number;
|
|
31
4
|
export {};
|
|
32
5
|
/**
|
|
@@ -10,14 +10,5 @@ export interface AmorArgs {
|
|
|
10
10
|
days: number;
|
|
11
11
|
yearDays: number;
|
|
12
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
13
|
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
14
|
//# sourceMappingURL=FinanceAmor.d.ts.map
|
|
@@ -1,21 +1,4 @@
|
|
|
1
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
2
|
export interface DatedFlows {
|
|
20
3
|
/** The flow at each ordinal. */
|
|
21
4
|
values: number[];
|
|
@@ -32,35 +32,7 @@ export declare function calculateCoupnum(settlementSerial: number, maturitySeria
|
|
|
32
32
|
* basis 0, actual days for 1–3, the European 30/360 for 4.
|
|
33
33
|
*/
|
|
34
34
|
export declare function calculateCoupdaybs(settlementSerial: number, maturitySerial: number, frequency: number, basis: number): number;
|
|
35
|
-
/**
|
|
36
|
-
* Days from settlement to the next coupon date (COUPDAYSNC). Actual days for bases 1–3. The
|
|
37
|
-
* 30/360 bases are NOT `getDayCount`'s (measured, 556 of 556 rows): the count runs from the
|
|
38
|
-
* settlement's own day — a 31 is 30, and a February month end is NOT 30 unless the
|
|
39
|
-
* settlement IS the previous coupon date, in which case the coupon date's unclamped day is
|
|
40
|
-
* read instead (`COUPDAYSNC(DATE(2011,2,28),DATE(2011,5,31),2,0)` is 92, from day 28;
|
|
41
|
-
* `COUPDAYSNC(DATE(2011,2,28),DATE(2011,8,29),2,0)` is 179, from the chain's `Feb 29`) — to
|
|
42
|
-
* the next coupon date carrying the maturity's day unclamped: at basis 0 a February day at or
|
|
43
|
-
* past the month's end is 30 and a 31 is 30 with no advance into the next month; basis 4
|
|
44
|
-
* caps both ends at 30.
|
|
45
|
-
*/
|
|
46
35
|
export declare function calculateCoupdaysnc(settlementSerial: number, maturitySerial: number, frequency: number, basis: number): number;
|
|
47
|
-
/**
|
|
48
|
-
* Days in the coupon period that contains settlement (COUPDAYS). Basis 3 is `365/frequency`
|
|
49
|
-
* and the 30/360 bases `360/frequency`. Basis 1 is Excel's own construction, measured on
|
|
50
|
-
* 2,302 rows (fn-battery financial/COUPDAYS + adhoc-coupdays-b1 + adhoc-coupdays-sweep) and
|
|
51
|
-
* NOT the next coupon minus the previous one (LibreOffice's reading; wrong on 30 of the
|
|
52
|
-
* battery's 225 rows). Excel walks TWO chains back from maturity: one whose day of month
|
|
53
|
-
* decays as it is clamped (`Aug 30 → Feb 29 → Aug 29 → Feb 28 → Aug 28`) and one that stays
|
|
54
|
-
* on the month's last day once a clamp lands there (`Aug 30 → Feb 29 → Aug 31 → Feb 28 →
|
|
55
|
-
* Aug 31`). The decaying chain is walked to the first date on or before the settlement; if
|
|
56
|
-
* the coupon after that date is not the same date in both chains, the period is the decaying
|
|
57
|
-
* chain's, otherwise it is the month-end chain's period around the settlement. So for a Nov 30
|
|
58
|
-
* maturity paid twice a year a settlement of Dec 15 sits in `Nov 30 → May 30` (181) while a
|
|
59
|
-
* settlement of May 30 sits in `Nov 30 → May 31` (182) and one of May 31 in `May 31 → Nov 30`
|
|
60
|
-
* (183). A period that begins below serial 1 is counted in real days (`_periodDays`).
|
|
61
|
-
*
|
|
62
|
-
* Used by: COUPDAYS and {@link couponPeriod}.
|
|
63
|
-
*/
|
|
64
36
|
export declare function calculateCoupdays(settlementSerial: number, maturitySerial: number, frequency: number, basis: number): number;
|
|
65
37
|
/**
|
|
66
38
|
* The four arguments of the six coupon functions, read in Excel's order — every one is
|
|
@@ -79,48 +51,13 @@ export declare function readCouponArgs(settlement: Omittable<Scalar>, maturity:
|
|
|
79
51
|
frequency: number;
|
|
80
52
|
basis: number;
|
|
81
53
|
};
|
|
82
|
-
/**
|
|
83
|
-
* The coupon-period numbers PRICE, YIELD, DURATION and MDURATION are built on, as Excel
|
|
84
|
-
* composes them (measured against Excel's own COUPNUM/COUPDAYBS/COUPDAYS/COUPDAYSNC answers on
|
|
85
|
-
* 572 shapes, fn-battery financial/PRICE + /DURATION, 2026-08-28): `N` is COUPNUM (NaN, the
|
|
86
|
-
* caller's #NUM!, when the previous coupon is below the calendar), `A` is COUPDAYBS, and the
|
|
87
|
-
* period length `E` is COUPDAYS — EXCEPT at basis 1, where it is the real span from the
|
|
88
|
-
* previous coupon to the next (`COUPDAYBS + COUPDAYSNC`), not COUPDAYS' two-chain value; the
|
|
89
|
-
* two differ on the month-end and February maturities (22 of the 225 basis-1 shapes). `DSC` is
|
|
90
|
-
* `E − A`, never COUPDAYSNC.
|
|
91
|
-
*/
|
|
92
54
|
export declare function couponPeriod(settlementSerial: number, maturitySerial: number, frequency: number, basis: number): {
|
|
93
55
|
N: number;
|
|
94
56
|
A: number;
|
|
95
57
|
E: number;
|
|
96
58
|
DSC: number;
|
|
97
59
|
};
|
|
98
|
-
/**
|
|
99
|
-
* Standard coupon bond price per $100 face value — the doc's closed form over
|
|
100
|
-
* {@link couponPeriod}'s numbers: with one coupon left `(coupon + redemption) / (1 + DSC/E ·
|
|
101
|
-
* yld/f) − coupon · A/E` (linear, not the power form), otherwise the redemption and each coupon
|
|
102
|
-
* discounted by `(1 + yld/f)^(k − 1 + DSC/E)` less the accrued coupon. Measured bit-for-bit on
|
|
103
|
-
* PRICE's battery (fn-battery financial/PRICE, 2026-08-28).
|
|
104
|
-
*
|
|
105
|
-
* The grouping is measured too, as ODDFPRICE's is: the coupon sum is accumulated on its own,
|
|
106
|
-
* forward, then the redemption term is added to it and the accrued coupon subtracted. Starting
|
|
107
|
-
* the accumulator at the redemption instead costs 146 of PRICE's 779 census rows and 74 of
|
|
108
|
-
* YIELD's 785 (SXL_CENSUS over the financial suite, 2026-09-09) — the terms and the divisions
|
|
109
|
-
* are identical either way, only the order the additions round in differs. It is visible in
|
|
110
|
-
* YIELD because that answer is a PARTIAL iterate.
|
|
111
|
-
*
|
|
112
|
-
* Used by: PRICE, YIELD.
|
|
113
|
-
*/
|
|
114
60
|
export declare function calculatePrice(settlementSerial: number, maturitySerial: number, rate: number, yld: number, redemption: number, frequency: number, basis: number): number;
|
|
115
|
-
/**
|
|
116
|
-
* `d/dy` of {@link calculatePrice}, term by term — the slope YIELD's Newton divides by. Analytic,
|
|
117
|
-
* not a difference quotient: a finite difference of any step reproduces neither the hundred-step
|
|
118
|
-
* answers of a redemption that dwarfs the price nor the partially-converged ones (fn-battery
|
|
119
|
-
* financial/adhoc-yield-fingerprint, 2026-09-09). A term that overflows makes the slope infinite,
|
|
120
|
-
* which the caller answers as #NUM!.
|
|
121
|
-
*
|
|
122
|
-
* Used by: YIELD.
|
|
123
|
-
*/
|
|
124
61
|
export declare function calculatePriceSlope(settlementSerial: number, maturitySerial: number, rate: number, yld: number, redemption: number, frequency: number, basis: number): number;
|
|
125
62
|
/**
|
|
126
63
|
* Macaulay duration of a coupon bond.
|
|
@@ -37,13 +37,6 @@ export declare const daysInMonth: (y: number, m: number) => number;
|
|
|
37
37
|
export declare const isMonthEnd: (x: DateFields) => boolean;
|
|
38
38
|
/** The workbook calendar's fields for a serial. */
|
|
39
39
|
export declare function getDateFields(serial: number): DateFields;
|
|
40
|
-
/**
|
|
41
|
-
* The serial of calendar fields, extended linearly BELOW the calendar (1899-12-31 is 0, and on
|
|
42
|
-
* down) and with a day past the month's end OVERFLOWING into the next month — a "Feb 30" is
|
|
43
|
-
* Mar 1. The coupon chains that walk off either end of the calendar are measured against Excel
|
|
44
|
-
* on those extended values, so they need an arithmetic that keeps producing them
|
|
45
|
-
* (fn-battery financial/ACCRINT and /ODDLPRICE).
|
|
46
|
-
*/
|
|
47
40
|
export declare function getSerialOfFields(y: number, m: number, d: number): number;
|
|
48
41
|
/** The fields `months` months on from `x`, the day clamped to the destination month. */
|
|
49
42
|
export declare function addMonthsClamped(x: DateFields, months: number): DateFields;
|
|
@@ -42,85 +42,11 @@ export interface DayCount {
|
|
|
42
42
|
*
|
|
43
43
|
*/
|
|
44
44
|
export declare function getDayCount(startSerial: number, endSerial: number, basis: number): DayCount;
|
|
45
|
-
/**
|
|
46
|
-
* Calculates the DAYS360 US method — signed integer day count.
|
|
47
|
-
*
|
|
48
|
-
* @see {@link getDayCount} (specifically `_getNasd30_360`) for the correct basis 0
|
|
49
|
-
* implementation used by financial formulas.
|
|
50
|
-
*
|
|
51
|
-
* @param startSerial The Excel serial date representing the start date.
|
|
52
|
-
* @param endSerial The Excel serial date representing the end date.
|
|
53
|
-
* @returns The signed number of days between the dates (negative if endSerial < startSerial).
|
|
54
|
-
*
|
|
55
|
-
* @remarks
|
|
56
|
-
* **Implementation Note:** This function is strictly for the `DAYS360` formula.
|
|
57
|
-
* It must NOT be used for standard financial functions like `YEARFRAC`, `ACCRINT`, or `PRICE`.
|
|
58
|
-
*
|
|
59
|
-
* It deliberately differs from the standard NASD 30/360 convention (basis 0) on two points,
|
|
60
|
-
* both measured against Excel:
|
|
61
|
-
*
|
|
62
|
-
* 1. The February End-of-Month conversion (startDay → 30) CASCADES into the end-day rule.
|
|
63
|
-
* Feb 28 to Mar 31 in 2011 is 30 days here and 31 days under basis 0.
|
|
64
|
-
* 2. End-of-February is decided on the LEGACY calendar — the day after the start falls in
|
|
65
|
-
* March — where basis 0 asks the REAL calendar. The two disagree only across the phantom
|
|
66
|
-
* `1900-02-29`: `DAYS360(59,91)` is 33 and `DAYS360(60,91)` is 30, while the same pairs
|
|
67
|
-
* under basis 0 are 31/360 and 32/360.
|
|
68
|
-
*
|
|
69
|
-
* The arguments are NOT swapped into order first. `DAYS360` is not antisymmetric — the rules
|
|
70
|
-
* apply to (start, end) as given, so `DAYS360(3/15, 3/31)` is 16 but `DAYS360(3/31, 3/15)`
|
|
71
|
-
* is −15, and `DAYS360(43496, 0)` is −42870 against `DAYS360(0, 43496)` = 42871.
|
|
72
|
-
*
|
|
73
|
-
* We replicate Excel's exact behavior, which utilizes different 30/360 rulesets
|
|
74
|
-
* for DAYS360 vs. NASD-based functions.
|
|
75
|
-
*
|
|
76
|
-
* https://en.wikipedia.org/wiki/Day_count_convention
|
|
77
|
-
*
|
|
78
|
-
*/
|
|
79
45
|
export declare function getDays360US(startSerial: number, endSerial: number): number;
|
|
80
46
|
/** The last serial of the 1900 calendar (9999-12-31). */
|
|
81
47
|
export declare const MAX_SERIAL_DATE = 2958465;
|
|
82
|
-
/**
|
|
83
|
-
* Excel's date-slot domain for the day-count family, measured on DAYS360, YEARFRAC, DATEDIF
|
|
84
|
-
* and the six coupon functions (fn-battery financial/*, 2026-08-28): the RAW value must not be
|
|
85
|
-
* negative (`-1E-9` is #NUM!) and the truncated serial must not pass 9999-12-31 (`2958465.9` is
|
|
86
|
-
* a legal 9999-12-31). The fraction is otherwise discarded by every function in the family.
|
|
87
|
-
*/
|
|
88
48
|
export declare function isSerialDateInRange(serial: number): boolean;
|
|
89
|
-
/**
|
|
90
|
-
* `YEARFRAC` — measured against Excel 16.0 (fn-battery financial/YEARFRAC, 2026-08-28). Both
|
|
91
|
-
* serials are truncated first, the earlier date becomes the start, and basis 0 is then the
|
|
92
|
-
* SIGNED NASD count: Excel orders the dates but never takes a magnitude, so
|
|
93
|
-
* `YEARFRAC(59,60,0)` — 1900-02-28, a real month end, against the phantom 1900-02-29 that is
|
|
94
|
-
* not — is `-1/360`. The other bases cannot go negative once ordered. The caller has validated
|
|
95
|
-
* the serials and the basis.
|
|
96
|
-
*/
|
|
97
49
|
export declare function getYearFrac(startSerial: number, endSerial: number, basis: number): number;
|
|
98
|
-
/**
|
|
99
|
-
* The years to maturity a bond-yield ITERATION starts from — not `YEARFRAC`, and not the coupon
|
|
100
|
-
* count over the frequency. Whole years are stepped off the settlement (the day clamped to each
|
|
101
|
-
* destination month) and the remainder is the basis's own day count over the basis's year: the
|
|
102
|
-
* 30/360 counts over 360 at bases 0 and 4, real days over 360 at basis 2 and over 365 at basis 3,
|
|
103
|
-
* and real days over the MATURITY'S OWN year at basis 1 — 366 out of a leap year, whatever the
|
|
104
|
-
* remainder itself covers. Basis 0's February here is the LEGACY calendar's: a Feb 29 start is a
|
|
105
|
-
* month end and a Feb 28 is not, which is neither `getDayCount`'s rule (the real calendar's month
|
|
106
|
-
* end, so Feb 28 counts too) nor `getDays360US`'s (which also lets the conversion steer the end).
|
|
107
|
-
*
|
|
108
|
-
* Measured on 1,154 rows where the answer depends on nothing else (fn-battery
|
|
109
|
-
* financial/adhoc-yield-n, -n2, -n3), 2026-09-09.
|
|
110
|
-
*
|
|
111
|
-
* Used by: YIELD, ODDFYIELD.
|
|
112
|
-
*/
|
|
113
50
|
export declare function getYearsToMaturity(settlement: number, maturity: number, basis: number): number;
|
|
114
|
-
/**
|
|
115
|
-
* The stub-period day count of AMORLINC/AMORDEGRC (the year fraction is `days / yearDays`, and
|
|
116
|
-
* the caller groups that as Excel does) — measured against Excel 16.0 (fn-battery
|
|
117
|
-
* financial/AMORLINC, /AMORDEGRC, 2026-08-28), and NOT YEARFRAC's: serials are truncated, the
|
|
118
|
-
* 30/360 bases count days as `getDayCount` does over 360, basis 3 is actual days over 365, and
|
|
119
|
-
* basis 1 is actual days over the length of the PURCHASE year (366 only when that year is a
|
|
120
|
-
* Gregorian leap year — 1900 is not — whatever the span crosses; 2007-12-31 → 2008-12-31 is
|
|
121
|
-
* 366/365), and in both actual bases a real Feb 29 counts as the 28th (`_feb29AsFeb28`). A zero-day stub is a whole period (`purchase = first period`, or Dec 30 → Dec 31
|
|
122
|
-
* at basis 0), and a stub longer than a year is not capped. Basis 2 is not accepted by either
|
|
123
|
-
* function; the caller has refused it before this is called.
|
|
124
|
-
*/
|
|
125
51
|
export declare function getAmorDayCount(purchased: number, firstPeriod: number, basis: number): DayCount;
|
|
126
52
|
//# sourceMappingURL=FinanceDayCount.d.ts.map
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { Omittable, Scalar } from '@sheetxl/primitives';
|
|
2
|
-
/**
|
|
3
|
-
* The odd-coupon securities' shared machinery — the quasi-coupon chain of an irregular period
|
|
4
|
-
* and the day-count sums the price and yield forms are built from, measured against Excel 16.0
|
|
5
|
-
* (fn-battery financial/ODDLPRICE + /ODDLYIELD + /ODDFPRICE and the `adhoc-oddl-*` /
|
|
6
|
-
* `adhoc-oddf-*` probes, 2026-08-28/29).
|
|
7
|
-
*/
|
|
8
2
|
/**
|
|
9
3
|
* `(settlement, maturity, …dates, …numbers, frequency, [basis])` as the four ODD functions read
|
|
10
4
|
* it: every slot is Excel-declared `any` (a boolean is #VALUE!, an empty argument #N/A, a blank
|
|
@@ -21,67 +15,11 @@ export declare function readOddArgs(dates: Omittable<Scalar>[], numbers: Omittab
|
|
|
21
15
|
frequency: number;
|
|
22
16
|
basis: number;
|
|
23
17
|
};
|
|
24
|
-
/**
|
|
25
|
-
* The three day-count sums of the odd LAST period `[lastInterest, maturity]`, in coupon-period
|
|
26
|
-
* units — the numbers ODDLPRICE and ODDLYIELD are built from. Measured on 1,780
|
|
27
|
-
* (shape, frequency, basis) triples, each sum exact (`fn-battery/financial/fit-oddl.mjs`).
|
|
28
|
-
*
|
|
29
|
-
* It takes TWO chains, as COUPDAYS' basis 1 did (batch 3): the DECAYING chain anchored at
|
|
30
|
-
* `lastInterest` gives the period ends and their lengths, while the STICKY chain decides only
|
|
31
|
-
* which period the maturity lands in — so an Aug 31 maturity against a decayed Aug 28 boundary
|
|
32
|
-
* is still inside the period that ENDS there and overhangs it by three days.
|
|
33
|
-
*
|
|
34
|
-
* Over the periods `[B₀ = lastInterest, B₁] … [B_{J−1}, B_J]`:
|
|
35
|
-
*
|
|
36
|
-
* - `A` and `DSC` walk their span (`lastInterest → settlement`, `settlement → maturity`) period
|
|
37
|
-
* by period, no period contributing more than itself — a 31st period end counted raw runs one
|
|
38
|
-
* day past its own length.
|
|
39
|
-
* - `DC` counts every period 1 except the last, which is measured BACKWARD from its end,
|
|
40
|
-
* `(NL − count(maturity, B_J)) / NL`. That is what makes `DC ≠ A + DSC` at basis 0.
|
|
41
|
-
*
|
|
42
|
-
* A chain that leaves the calendar is #NUM!: past its end going forward, and — stepping BACK
|
|
43
|
-
* from the MATURITY to the first date at or below `lastInterest` — below serial 1 going back
|
|
44
|
-
* (measured: a ladder landing on serial 1 computes, one landing on serial 0 is #NUM!).
|
|
45
|
-
*/
|
|
46
18
|
export declare function oddLastSums(settlement: number, maturity: number, lastInterest: number, frequency: number, basis: number): {
|
|
47
19
|
A: number;
|
|
48
20
|
DC: number;
|
|
49
21
|
DSC: number;
|
|
50
22
|
};
|
|
51
|
-
/**
|
|
52
|
-
* The numbers ODDFPRICE's form is built from — `N` regular coupons after `firstCoupon`, the
|
|
53
|
-
* accrued sum `A` and the first coupon's sum `DC` (both in coupon-period units), and `u`, the
|
|
54
|
-
* fractional exponent every cash flow after the settlement is discounted by. Measured on 1,125
|
|
55
|
-
* (shape, frequency, basis) triples, the four sums solved out of Excel by linearity
|
|
56
|
-
* (`fn-battery/financial/oddf-model.mjs`, `verify-oddf.mjs`, `adhoc-oddf-*`, 2026-08-29).
|
|
57
|
-
*
|
|
58
|
-
* The maturity must sit on `firstCoupon`'s grid — `COUPPCD(firstCoupon, maturity) = firstCoupon`
|
|
59
|
-
* — and the doc's two branches are real, on DIFFERENT date machinery. `E` is the regular period
|
|
60
|
-
* around the settlement on that grid, PRICE's {@link couponPeriod} (`COUPDAYBS + COUPDAYSNC` at
|
|
61
|
-
* basis 1); `DFC` the basis's count issue → firstCoupon:
|
|
62
|
-
*
|
|
63
|
-
* - `DFC = E` is #NUM! — an odd period that is exactly a regular one.
|
|
64
|
-
* - SHORT (`DFC < E`): one period, every count over `E` — `A = issue→settlement`, `DC = DFC`,
|
|
65
|
-
* `u = settlement→firstCoupon`, the last straight from the settlement (the NASD advance
|
|
66
|
-
* included). `N` is `COUPNUM(settlement, maturity) − 1`, which counts a grid date between the
|
|
67
|
-
* settlement and the first coupon when there is one (a settlement in the gap between a
|
|
68
|
-
* decayed boundary and its sticky twin).
|
|
69
|
-
* - LONG (`DFC > E`): `COUPNUM(issue, firstCoupon)` quasi periods on the STICKY grid, their
|
|
70
|
-
* boundaries walked DECAYED back from `firstCoupon` (each step subtracts `12/f` months from
|
|
71
|
-
* the previous date and clamps: an Aug 31 anchor semiannual is Feb 28, then Aug 28) — so the
|
|
72
|
-
* earliest period can end at or before the issue and count nothing. `NL` is each period's
|
|
73
|
-
* own actual span at basis 1, `360/f` or `365/f` elsewhere; `A` walks issue → settlement as
|
|
74
|
-
* days over `NL`; `DC` is the issue's period as days over `NL` and every later period exactly
|
|
75
|
-
* 1 (the doc's DCᵢ — visible at bases 2 and 3). The exponent `u = Nq + DSC/E` is on the
|
|
76
|
-
* sticky grid instead: `DSC = E − COUPDAYBS` at bases 0/1/4 and the actual days to the next
|
|
77
|
-
* grid date at 2/3, and `Nq` is `COUPNUM(settlement, firstCoupon) − 1` PLUS ONE on a
|
|
78
|
-
* month-end first coupon — Excel discounts every cash flow one period too far — unless the
|
|
79
|
-
* settlement is itself a month end or its month holds an earlier quasi-coupon date
|
|
80
|
-
* (`adhoc-oddf-nq`, 957 settlements swept day by day).
|
|
81
|
-
*
|
|
82
|
-
* A chain that walks below the calendar is #NUM! in either branch (a settlement in the first
|
|
83
|
-
* days of 1900 has quasi dates in 1899).
|
|
84
|
-
*/
|
|
85
23
|
export declare function oddFirstSums(settlement: number, maturity: number, issue: number, firstCoupon: number, frequency: number, basis: number): {
|
|
86
24
|
N: number;
|
|
87
25
|
A: number;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { Omittable, Scalar } from '@sheetxl/primitives';
|
|
2
|
-
/**
|
|
3
|
-
* Argument readers for the securities functions — every slot Excel-declared `any`, read in the
|
|
4
|
-
* order Excel reads them (measured against Excel 16.0, fn-battery financial/*, 2026-08-28).
|
|
5
|
-
*
|
|
6
|
-
* Two orders exist in the family. The discount securities (DISC PRICEDISC YIELDDISC INTRATE
|
|
7
|
-
* RECEIVED) CONVERT from the last slot to the first and only then look for errors in slot
|
|
8
|
-
* order; ACCRINTM, ACCRINT and the coupon functions convert and validate each slot from the
|
|
9
|
-
* first. Each function names its own.
|
|
10
|
-
*/
|
|
11
2
|
/** The basis slot: omitted or blank is 0, text parses, a boolean is #VALUE!, out of 0–4 after truncation is #NUM!. */
|
|
12
3
|
export declare function readBasis(basis: Omittable<Scalar>): number;
|
|
13
4
|
/** The two dates of a security, truncated, both in the calendar and the settlement strictly first — else #NUM!. */
|
|
@@ -61,17 +52,6 @@ export declare function readMatArgs(settlement: Omittable<Scalar>, maturity: Omi
|
|
|
61
52
|
A: number;
|
|
62
53
|
B: number;
|
|
63
54
|
};
|
|
64
|
-
/**
|
|
65
|
-
* `(settlement, maturity, …numbers, frequency, [basis])` as PRICE, YIELD, DURATION and
|
|
66
|
-
* MDURATION read it (measured on all four, fn-battery 2026-08-28). PRICE and YIELD read the
|
|
67
|
-
* basis FIRST — coerced and range-checked, so a text basis is #VALUE! and a 5 is #NUM! whatever
|
|
68
|
-
* else is wrong, and an error there wins over an error in the settlement; DURATION and
|
|
69
|
-
* MDURATION read it LAST (`basisLast`), the coupon functions' way. In between, the settlement
|
|
70
|
-
* and the maturity are each coerced and checked against the calendar before the next slot is
|
|
71
|
-
* read (a negative settlement is #NUM! over a text frequency), then the numeric slots are
|
|
72
|
-
* coerced, then the frequency is coerced and validated (1, 2 or 4 after truncation); the date
|
|
73
|
-
* order (`settlement < maturity` once truncated) and the signs of the numbers come last.
|
|
74
|
-
*/
|
|
75
55
|
export declare function readBondArgs(settlement: Omittable<Scalar>, maturity: Omittable<Scalar>, numbers: Omittable<Scalar>[], frequency: Omittable<Scalar>, basis: Omittable<Scalar>, basisLast?: boolean): {
|
|
76
56
|
settlement: number;
|
|
77
57
|
maturity: number;
|
|
@@ -79,6 +59,5 @@ export declare function readBondArgs(settlement: Omittable<Scalar>, maturity: Om
|
|
|
79
59
|
frequency: number;
|
|
80
60
|
basis: number;
|
|
81
61
|
};
|
|
82
|
-
/** Excel's Analysis-ToolPak arithmetic answers 0 for a product that overflowed (measured on ACCRINTM, TBILLEQ, TBILLPRICE, PRICEMAT). */
|
|
83
62
|
export declare const overflowIsZero: (value: number) => number;
|
|
84
63
|
//# sourceMappingURL=FinanceSecurity.d.ts.map
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { IRuntime } from '@sheetxl/primitives';
|
|
2
|
-
/**
|
|
3
|
-
* The secant step cap shared by RATE and IRR — Excel gives up after 200, not the documented 20
|
|
4
|
-
* (measured on one 24-period loan: a path of 200 steps converges, one of 203 is #NUM!). IRR runs
|
|
5
|
-
* the same iteration on the discount factor rather than the rate, so the cap is one fact.
|
|
6
|
-
*/
|
|
7
2
|
export declare const RATE_MAX_ITERATIONS = 200;
|
|
8
3
|
/**
|
|
9
4
|
* The currency format Excel gives a financial result cell, in the runtime's locale.
|
|
@@ -21,34 +16,7 @@ export declare const RATE_MAX_ITERATIONS = 200;
|
|
|
21
16
|
* body instead of following the domain guards.
|
|
22
17
|
*/
|
|
23
18
|
export declare const defaultCurrencyFormat: (runtime: IRuntime) => string;
|
|
24
|
-
/**
|
|
25
|
-
* `base ^ exponent` as Excel evaluates it (the `^` operator, POWER, and the powers inside the
|
|
26
|
-
* time-value-of-money functions all agree — measured 2026-08-26, Excel 16.0 build 20326).
|
|
27
|
-
*
|
|
28
|
-
* For an INTEGER exponent of magnitude up to 4294967294 (2^32 − 2) Excel does not call a
|
|
29
|
-
* correctly rounded pow: it multiplies — right-to-left binary exponentiation, a negative exponent
|
|
30
|
-
* as the reciprocal of the positive power — and the rounding of every intermediate product is
|
|
31
|
-
* carried into the result. That is invisible at the 15th digit of `(1+r)^n` itself, but a caller
|
|
32
|
-
* that divides `(1+r)^n − 1` by a small `r` amplifies the last bits: `FV(1E-9,360,-100,-1000)`
|
|
33
|
-
* agrees with Excel to 8 digits on `Math.pow` and is bit-exact on this form. From 2^32 − 1 up, and
|
|
34
|
-
* for every non-integer exponent, Excel is `exp(y · ln x)` in double — closer to it than libm pow
|
|
35
|
-
* on the sensitive rows (`FV(1E-15,12.5,…)` is 2 digits on `Math.pow`, exact here), and equal to
|
|
36
|
-
* it everywhere else measured.
|
|
37
|
-
*
|
|
38
|
-
* A zero base follows the `^` operator: `0^0` is #NUM! and `0^negative` is #DIV/0!.
|
|
39
|
-
*/
|
|
40
19
|
export declare const excelPow: (base: number, exponent: number) => number;
|
|
41
|
-
/**
|
|
42
|
-
* Excel's C `(int)` cast of an argument: truncation toward zero, and INT_MIN for anything out of
|
|
43
|
-
* the 32-bit range (the x64 `cvttsd2si` convention), NaN included. Measured on DB (fn-battery,
|
|
44
|
-
* 2026-08-28): `DB(…,3E9,2E9)` is #NUM! because only `life` overflows to INT_MIN while
|
|
45
|
-
* `DB(…,1E10,5E9)` is 0 because both do.
|
|
46
|
-
*/
|
|
47
20
|
export declare const excelInt32: (value: number) => number;
|
|
48
|
-
/**
|
|
49
|
-
* Round to `digits` decimals as Excel's ROUND does: ties away from zero, decided on the value's
|
|
50
|
-
* 15-significant-digit decimal form rather than its binary one — `550 · 0.45` is
|
|
51
|
-
* 247.49999999999997 in double and Excel rounds it to 248 (AMORDEGRC, measured 2026-08-28).
|
|
52
|
-
*/
|
|
53
21
|
export declare const excelRound: (value: number, digits?: number) => number;
|
|
54
22
|
//# sourceMappingURL=FinanceUtils.d.ts.map
|