From f71efa89fee267da0c37c15e355ae2f45bd086bd Mon Sep 17 00:00:00 2001 From: Brian Bonner Date: Fri, 3 Dec 2021 17:08:49 -0500 Subject: [PATCH] fixed issue #3 --- lib/finance.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/finance.dart b/lib/finance.dart index 9f53fcf..73ecdad 100644 --- a/lib/finance.dart +++ b/lib/finance.dart @@ -385,7 +385,7 @@ class Finance { static num npv( {@required required num rate, @required required List values}) { return List.generate(values.length, (int index) => index) - .map((int index) => values[index] / pow(1 + rate, index)) + .map((int index) => values[index] / pow(1 + rate, index + 1)) .fold(0, (num p, num c) => p + c); }