Repository navigation
BusinessMath 2.11.0 — The Excel financial ten, and a February rule 30/360 was missing
v2.11.0 — the Excel financial ten, and a February rule 30/360 was missing
SLN, SYD, DDB, VDB, RATE, NPER, PDURATION, NOMINAL and ACCRINT, plus the three
day-count conventions they needed: actualActual (the rule YEARFRAC's basis 1
applies), isdaActualActual (the standard), and thirty360European.
Verified against a spreadsheet rather than against our own arithmetic. The coverage
proposal asked for a workbook whose values are the oracle; LibreOffice Calc was on
the machine, so that is now literal — a generated flat-ODS with no cached values,
evaluated headless, read back at fifteen significant digits. 191 committed cases.
Fixed
- DayCountConvention.thirty360 omitted the NASD February end-of-month rule.
28 February to 31 July counted 153 days where a spreadsheet counts 151, and four
of eight February cases were wrong. Two details, neither obvious: the last day of
February counts as a 30th, and the pull-back of an end date on the 31st tests the
start day before that February adjustment rather than after. Confirmed against a
value Excel itself cached in a real workbook — YEARFRAC(2020-02-29, 2020-12-31) is
301/360 — which discriminates between all three candidate orderings. - Straight-line depreciation ignored salvage in both places it existed. Both now
delegate to the general function, which takes one. - RealEstateModel.annualDepreciation justified an unguarded division on the grounds
that its recovery period "defaults to 27.5, always > 0". The default says nothing
about what a caller passed.
Source compatibility
- DayCountConvention gained three cases: a source break for an exhaustive switch,
and the only such cost in the release. - The thirty360 fix changes numbers for any accrual starting on a February month
end. The new answer is the spreadsheet's.
ACCRINT is the one function here not verified by the workbook. LibreOffice is wrong
for it twice over — a 30/360 day count contradicting its own DAYS360, YEARFRAC and
COUPDAYBS, and a basis 1 dividing actual days by the length of the year containing
the issue date. Excel returns 208.333333 where LibreOffice returns 210.069444 for
the documented case; ours matches Excel, and LibreOffice's cases were removed from
the fixture rather than corrected.
6,867 tests / 607 suites. quality-gate --check all: 45 of 45, 0 errors, 0 warnings.