• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tubedude / finance-elixir / ededb426f1ebdfc65188323b423159f12099a44d
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 06 Jul 2026 07:04AM UTC
Jobs 1
Files 12
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Jul 2026 07:03AM UTC coverage: 100.0%. Remained the same
ededb426f1ebdfc65188323b423159f12099a44d

push

github

web-flow
Guard against rates at or below -100% and fix rounding in ytm (#28)

* Domain guards, discounting cleanup, and review fixes (1.6.1)

Correctness:
- A rate at or below -100% returns {:error, :undefined} instead of raising
  ArithmeticError or returning garbage everywhere (1 + rate)^t is computed:
  xnpv/npv/mirr, TVM fv/pv/pmt/amortization_schedule, Bonds price + risk
  metrics, Returns dpp/profitability_index/twr, effective_annual_rate, sln.
  nominal_rate(-1.0, m) now returns -m so it stays the inverse of
  effective_annual_rate at total loss.
- Bonds duration/modified_duration/convexity return :undefined when a negative
  coupon zeroes the price, rather than a nonsensical value or a crash.
- ytm and profitability_index round once at full precision (ytm's periodic
  rounding was amplified by freq); a regression test pins ytm at the default
  precision.
- xirr(dates, []) returns :mismatched_lengths instead of crashing.
- Drop the broad rescue in normalize (dates parse via Date.from_erl/1); a
  malformed amount raises as a caller bug instead of being mislabeled
  :invalid_date.

Consistency and cleanup:
- Centralize discounting in one overflow-safe (1 + rate)^-t helper
  (Shared.discount_factor), used by present_value and the bond/returns metrics,
  which previously used a divide form that could overflow.
- Validate :precision as 0..15; accept integer :guess/:tolerance. Require an
  integer Bonds freq; reject a fractional syd period.
- Bracket scan stops one step sooner when the root sits at the guess. Hoist the
  solvers' safely/1 and rounding into Shared; dedupe the amortization row
  converters; trim comments that restated code.

Testing:
- Run the solver fuzz properties against both Newton and Brent, and add a
  dated, many-flow, random-sign XIRR property (only 2-flow dated series were
  fuzzed before). A real Newton/Brent robustness bug would surface here.

* Lower the Elixir floor to ~> 1.15 and test it in CI

Widen the CI matrix to 1.15.8/25 and... (continued)

104 of 104 new or added lines in 9 files covered. (100.0%)

450 of 450 relevant lines covered (100.0%)

63772.41 hits per line

Jobs
ID Job ID Ran Files Coverage
1 ededb426f1ebdfc65188323b423159f12099a44d.1 06 Jul 2026 07:04AM UTC 12
100.0
GitHub Action Run
Source Files on build ededb426f1ebdfc65188323b423159f12099a44d
  • Tree
  • List 12
  • Changed 10
  • Source Changed 0
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • ededb426 on github
  • Prev Build on main (#CC30D2EA...)
  • Next Build on main (#B1DAF2B8...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc