diff options
author | bebert218 <guillaume.viry@gmail.com> | 2013-05-22 13:58:38 +0900 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-05-29 08:17:14 -0600 |
commit | e50475a64050bdea104d39ad2c487e847fe4b031 (patch) | |
tree | a9faba486bfecddceef1b6ede79345eefcb21bbd /numpy/lib/tests/test_financial.py | |
parent | 1f11f22ad71da9cb95b541be01fbfb4eed6d3d5b (diff) | |
download | numpy-e50475a64050bdea104d39ad2c487e847fe4b031.tar.gz |
BUG: The npv function in financial.py was incorrectly implemented.
Correct the implementation of the npv function, its documentation, and
the mirr function that depends on it. The test_financial.py is also
corrected to take into account those modifications
The npv function behavior was contrary to what the documentation stated
as it summed indexes 1 to M instead of 0 to M-1. The mirr function used
a corrective factor to get the correct result in spite of that error so
that factor is removed.
Closes #649
Diffstat (limited to 'numpy/lib/tests/test_financial.py')
-rw-r--r-- | numpy/lib/tests/test_financial.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_financial.py b/numpy/lib/tests/test_financial.py index d76948582..1a276a429 100644 --- a/numpy/lib/tests/test_financial.py +++ b/numpy/lib/tests/test_financial.py @@ -41,7 +41,7 @@ class TestFinancial(TestCase): def test_npv(self): assert_almost_equal(np.npv(0.05,[-15000,1500,2500,3500,4500,6000]), - 117.04, 2) + 122.89, 2) def test_mirr(self): val = [-4500,-800,800,800,600,600,800,800,700,3000] |