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.
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 byr
and returnsNaN
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.