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

fv.annunity fails for zero discount rate #2

Open
jsjuni opened this issue Jul 30, 2023 · 1 comment · May be fixed by #3
Open

fv.annunity fails for zero discount rate #2

jsjuni opened this issue Jul 30, 2023 · 1 comment · May be fixed by #3

Comments

@jsjuni
Copy link

jsjuni commented Jul 30, 2023

Although an edge case, the value of an annuity with a zero discount rate is mathematically well-defined. The formula in fv.annuity(), however, divides by r and returns NaN for a zero discount rate.

I've made a fix and will submit a pull request. The value for the zero discount rate case is the limit (using L'Hôpital's rule) as r goes to zero.

@jsjuni
Copy link
Author

jsjuni commented Aug 4, 2023

I've made similar updates to pv.annuity(), n.period(), and pmt().

@jsjuni jsjuni linked a pull request Aug 4, 2023 that will close this issue
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 a pull request may close this issue.

1 participant