Skip to content

Comments

refactor: bisect all accumulating savings calculations#20

Merged
johannschopplich merged 4 commits intomainfrom
feat/bisect-all-accumulating
Nov 17, 2025
Merged

refactor: bisect all accumulating savings calculations#20
johannschopplich merged 4 commits intomainfrom
feat/bisect-all-accumulating

Conversation

@alex-rie
Copy link
Contributor

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme or JSDoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alex-rie alex-rie requested a review from Copilot November 17, 2025 08:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@finanzfluss finanzfluss deleted a comment from Copilot AI Nov 17, 2025
@johannschopplich johannschopplich merged commit 5673c41 into main Nov 17, 2025
5 checks passed
@johannschopplich johannschopplich deleted the feat/bisect-all-accumulating branch November 17, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants