-
-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
Milestone
Description
Proposed new feature or change:
I've just merged #118, this PR reproduced the behaviour of nper
in Cython as closely as possible. However there are several ZeroDivisionError
s that are currently handled poorly (they return NAN
s).
numpy-financial/numpy_financial/_cfinancial.pyx
Lines 21 to 22 in 8583586
z = pmt_ * (1.0 + rate_ * when_) / rate_ | |
return log((-fv_ + z) / (pv_ + z)) / log(1.0 + rate_) |
In each case, we should carefully evaluate each code path and return a financially sensible result.