fix: preserve XIRR under cash-flow scaling and avoid residual product overflow - #68
Open
Altairpaca wants to merge 2 commits into
Open
Altairpaca wants to merge 2 commits into
Altairpaca wants to merge 2 commits into
Conversation
Owner
Author
|
Full-suite verification for head |
Altairpaca
marked this pull request as ready for review
September 12, 2026 09:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #67.
Minimal numerical correction
Use exact zero or the existing dimensionless rate-bracket tolerance for convergence. Compare signs without multiplying residuals. Keep the existing bracket domain/expansion, 160-step bisection limit, ACT/365 convention and missing-sign behavior.
Regression evidence
The exact source blob
42f949891b3c7b503d1962337c85edc2bb835ef3from base149645a6a5ef97dea99458bf036d1b92e223907cwas materialized and Git-hash checked. Eight isolated xirr tests produce six failing subtests and one error before the fix; all eight pass after it. The isolated runner supplies the existing finite Decimal parser and does not exercise ledger integration.Full repository CI run 34685592956 passed on Python 3.12 and 3.13 for head
a4416aa9ba8c8094d7bf70cad3318cc88fce25fa. The inspected 3.13 log reports 237 passed, 4 skipped, 12 subtests passed, plus successful compilation, whitespace and distribution builds. Checkout was merge previewde3ae6dee521d93830df9ac2fa60a2a5c68d49d8against the base above. No source changed after verification. Ready for review; skipped tests are not counted as executed acceptance.Compatibility / scope
This corrects wrong rates for small amounts and sign-comparison range failures; it does not claim to solve all Decimal extremes, enumerate multiple IRRs, change no-bracket conventions, add a feature milestone, or measure portfolio performance. Existing real-host and provider gates are unaffected.