! Copyright (C) 2013 Loryn Jenkins. ! See http://factorcode.org/license.txt for BSD license. USING: kernel tools.test financial-functions hashtables math math.functions ; IN: financial-functions.tests : cashflow1 ( -- hashtable ) H{ { 1 4000.00 } { 2 400.00 } { 3 3000.00 } { 4 2000.00 } { 5 1000.00 } } clone ; [ 3 ] [ 7000.00 cashflow1 payback ] unit-test [ 4 ] [ 0.09 7000.00 cashflow1 discounted-payback ] unit-test [ 138973.0 ] [ 0.09 7000.00 cashflow1 npv 2 10^ * round ] unit-test [ 1779.0 ] [ 0.09 7000.00 cashflow1 irr 4 10^ * round ] unit-test