Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pmt when interest rate is 0 #41

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

rmm5t
Copy link
Contributor

@rmm5t rmm5t commented Sep 9, 2024

Fixes #10. pmt returned NaN when passed a rate of 0.0.

(#10 was mistakenly closed prematurely)

BEFORE

>> Exonio::VERSION
=> "0.7.0"
>> Exonio.pmt(0.0, 36, 36_000)
=> NaN

AFTER

>> Exonio.pmt(0.0, 36, 36_000)
=> -1000

@rmm5t
Copy link
Contributor Author

rmm5t commented Sep 9, 2024

Given the partial build matrix failures, I'm going to submit another PR to help fix those.

Update: #42

lib/exonio/financial.rb Outdated Show resolved Hide resolved
@rmm5t rmm5t force-pushed the 10-fix-pmt-when-rate-0 branch 2 times, most recently from 737ca6a to c78ecf0 Compare September 9, 2024 20:19
@julianolf
Copy link
Member

Thanks for the contribution @rmm5t!

@julianolf julianolf merged commit 2dce2b8 into noverde:main Sep 9, 2024
10 checks passed
@rmm5t rmm5t deleted the 10-fix-pmt-when-rate-0 branch September 9, 2024 21:28
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.

pmt returns NaN if interest rate is 0
2 participants