refactor: bisect all accumulating savings calculations#20
refactor: bisect all accumulating savings calculations#20johannschopplich merged 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the accumulating savings calculations to use a unified bisection approach instead of specialized closed-form financial functions. The change removes three accumulating-taxed variants (pmtAccumulatingTaxed, pvAccumulatingTaxed, and nperAccumulatingTaxed) from the financial utilities and replaces their usage with calls to bisectByEndValue across the savings calculators.
Key changes:
- Removed three accumulating-taxed financial functions that handled capital gains tax calculations
- Updated savings calculators (payment, start value, duration) to use bisection method for accumulating distribution calculations
- Simplified test expectations by removing special-case tolerance handling for monthly intervals
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/utils/financial.ts | Removed pmtAccumulatingTaxed, pvAccumulatingTaxed, and nperAccumulatingTaxed functions |
| src/calculators/savings-payment.ts | Replaced pmtAccumulatingTaxed with bisectByEndValue for accumulating distribution |
| src/calculators/savings-start-value.ts | Replaced pvAccumulatingTaxed with bisectByEndValue for accumulating distribution |
| src/calculators/savings-duration.ts | Replaced nperAccumulatingTaxed with bisectByEndValue for accumulating distribution |
| test/utils/savings-utils.test.ts | Removed special-case tolerance handling for monthly save/interest intervals |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🔗 Linked issue
❓ Type of change
📚 Description
📝 Checklist