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