You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yep, you're correct. It's because the author was using index for the time period (which is zero based in his code), but needs to have 1 added to correctly calculate the NPV.
I added a pull request to add null safety and to fix the NPV calculation and tests
Hi,
For below calculations NPV is giving wrong results.
print(Finance.npv(rate: 0.05, values: <num>[1500, 2500, 3500, 4500, 6000]));
Answer through above code is : 15879.03959769849
But the correct answer is : 15122.89
The text was updated successfully, but these errors were encountered: