Skip to content

BUG: preserve fractional fv results with integer rates - #170

Open
naseweisssss wants to merge 1 commit into
numpy:mainfrom
naseweisssss:codex/fv-integer-rate
Open

naseweisssss wants to merge 1 commit into
numpy:mainfrom
naseweisssss:codex/fv-integer-rate

Conversation

@naseweisssss

@naseweisssss naseweisssss commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

#167 Giving credit to this PR, but added more test , this is intended to resolve #166

@naseweisssss
naseweisssss marked this pull request as ready for review October 19, 2026 20:37

@seberg seberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, LGTM... I was hesitant a bit wondering if we can avoid the result_type here, but it seems hard without anything else.
(And even if, it would seem to require quite a refactor.

I'd love if someone else would have a look, but that seems unlikely here :)

@naseweisssss

naseweisssss commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks, LGTM... I was hesitant a bit wondering if we can avoid the result_type here, but it seems hard without anything else. (And even if, it would seem to require quite a refactor.

I'd love if someone else would have a look, but that seems unlikely here :)

Thanks for approving but seems like it requires some other access to do this here.

@AbhiRKeesara

Copy link
Copy Markdown
Contributor

@naseweisssss Thanks for this PR and mentioning of PR from kritagyadubey for credit.

A small ask if it's ok. Can we also add his name as co-contributor in the description if his changes have helped instead of just the PR reference?

@kritagyadubey - If you can, would you mind reviewing this PR before its merged?

@kritagyadubey kritagyadubey 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.

@AbhiRKeesara thanks for the nudge - happy to review.

I went through the changes and I'm happy with them, so approving here. The fix is the same idea as what I had in #167 - taking the result dtype from all the inputs instead of just rate - and the tests here go further than mine, especially the ppmt/ipmt cases at 0% and the float32/Decimal checks. I double-checked the expected numbers in the new tests and they all come out right. CI is green as well.

One small optional suggestion: a short comment above the empty_like line saying why the dtype comes from all the inputs would help stop it from being simplified back later.

Thanks @naseweisssss for taking this on and for crediting #167 - good to merge from my side.

@kritagyadubey

kritagyadubey commented Oct 25, 2026 via email

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An integer rate truncates fv to an integer and makes ipmt/ppmt raise

4 participants