From b21be67447392e59eace316f8708c4e17fa70a35 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Tue, 8 Apr 2008 20:43:07 +0000 Subject: Fix doc-tests for financial.py so they don't rely on floating-point exactness. Start filling in final function. --- numpy/lib/financial.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'numpy/lib/financial.py') diff --git a/numpy/lib/financial.py b/numpy/lib/financial.py index c5d6d27e7..5bb4a3af7 100644 --- a/numpy/lib/financial.py +++ b/numpy/lib/financial.py @@ -139,11 +139,13 @@ array([[[ 32.58497782, 38.57048452], """ def ipmt(rate, per, nper, pv, fv=0.0, when='end'): + total = pmt(rate, nper, pv, fv, when) + # Now, compute the nth step in the amortization raise NotImplementedError - def ppmt(rate, per, nper, pv, fv=0.0, when='end'): - raise NotImplementedError + total = pmt(rate, nper, pv, fv, when) + return total - ipmt(rate, per, nper, pv, fv, when) def pv(rate, nper, pmt, fv=0.0, when='end'): """Number of periods found by solving the equation -- cgit v1.2.1