Skip to content

Make Coupon::accruedDays consistent with accruedPeriod in the ex window#2652

Open
jmboyd1 wants to merge 1 commit into
lballabio:masterfrom
jmboyd1:fix-coupon-accrueddays-excoupon
Open

Make Coupon::accruedDays consistent with accruedPeriod in the ex window#2652
jmboyd1 wants to merge 1 commit into
lballabio:masterfrom
jmboyd1:fix-coupon-accrueddays-excoupon

Conversation

@jmboyd1

@jmboyd1 jmboyd1 commented Jul 9, 2026

Copy link
Copy Markdown

Coupon::accruedPeriod returns a negative year fraction between the ex-coupon date and the payment date, but accruedDays kept counting positive days from the accrual start, so the two inspectors report opposite signs for the same settlement date inside the ex window.

accruedDays now mirrors the accruedPeriod branch and returns minus the days from settlement to the accrual end — the day count that corresponds to the negative accrued amount.

Two-line change; the full test suite passes unchanged. Found while auditing ex-coupon behaviour for Australian government bonds (7-day ex-interest window, negative accrual).

Coupon::accruedPeriod returns a negative year fraction between the
ex-coupon date and the payment date, but accruedDays kept counting
positive days from accrual start, so the two reported opposite signs for
the same settlement. accruedDays now mirrors the accruedPeriod branch and
returns minus the days from settlement to accrual end.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 74.884% (-0.001%) from 74.885% — jmboyd1:fix-coupon-accrueddays-excoupon into lballabio:master

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.

3 participants