Skip to content

ACCRINT, ACCRINTM, COUPDAYBS, COUPDAYS, COUPDAYSNC, COUPNCD, COUPNUM, COUPPCD, DISC, DURATION, FVSCHEDULE, INTRATE, MDURATION, PRICE, PRICEDISC, PRICEMAT, RECEIVED, YIELD, YIELDDISC, YIELDMAT#54

Closed
BrianHung wants to merge 14 commits into
mainfrom
brian/financial-functions

Conversation

@BrianHung

Copy link
Copy Markdown
Owner

No description provided.

@BrianHung BrianHung mentioned this pull request Jul 30, 2025
cursor[bot]

This comment was marked as outdated.

@BrianHung

Copy link
Copy Markdown
Owner Author

cursor review
make sure there are comprehensive tests for each function, functions are ticked as available, and properly documented with their own page stub

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


Merged upstream/main (429 commits) while preserving 20 new financial
functions not yet in upstream:

Bond Duration/Price/Yield:
- DURATION, MDURATION
- PRICE, PRICEDISC, PRICEMAT
- YIELD, YIELDDISC, YIELDMAT

Accrued Interest:
- ACCRINT, ACCRINTM

Coupon Functions:
- COUPDAYBS, COUPDAYS, COUPDAYSNC
- COUPNCD, COUPNUM, COUPPCD

Other:
- DISC, INTRATE, RECEIVED, FVSCHEDULE

Implementation uses hardcoded function lookup (no language.bin changes).
All existing financial function tests pass (23 tests).
Added test modules that were present but not declared:
- test_fn_accrint (4 tests) - ACCRINT function
- test_fn_accrintm (4 tests) - ACCRINTM function
- test_fn_coupon (7 tests) - COUPDAYBS, COUPDAYS, COUPDAYSNC, etc.
- test_fn_duration (9 tests) - DURATION, MDURATION
- test_fn_financial_bonds (26 tests) - PRICE, YIELD, DISC, etc.
- test_fn_fvschedule (7 tests) - FVSCHEDULE

Total: 57 tests covering all 20 new financial functions.
All CI checks pass (format, clippy, 1049 tests).
@BrianHung BrianHung changed the title financial functions ACCRINT, ACCRINTM, COUPDAYBS, COUPDAYS, COUPDAYSNC, COUPNCD, COUPNUM, COUPPCD, DISC, DURATION, FVSCHEDULE, INTRATE, MDURATION, PRICE, PRICEDISC, PRICEMAT, RECEIVED, YIELD, YIELDDISC, YIELDMAT Feb 1, 2026
- Inline argument parsing to match codebase patterns (mathematical.rs)
- Fix ACCRINT: allow settlement before first_interest date
- Add Excel documentation example tests for ACCRINT/ACCRINTM
@BrianHung

Copy link
Copy Markdown
Owner Author

Superseded by split financial PRs (#75#80). Closing to avoid duplicate review.

@BrianHung BrianHung closed this Feb 6, 2026
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.

1 participant