lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] odd/eraseme_error 6c0d108 4/9: Add a couple obvious


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/eraseme_error 6c0d108 4/9: Add a couple obvious tests
Date: Thu, 8 Jul 2021 16:26:47 -0400 (EDT)

branch: odd/eraseme_error
commit 6c0d108685527fee603de5ec37a9ba0e92371d8c
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Add a couple obvious tests
---
 financial_test.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/financial_test.cpp b/financial_test.cpp
index 6ee234e..e9758e9 100644
--- a/financial_test.cpp
+++ b/financial_test.cpp
@@ -63,6 +63,9 @@ int test_main(int, char*[])
 
     LMI_TEST_EQUAL(  882.8125, fv(cash_flows + 0, cash_flows + 3,  0.25));
     LMI_TEST_EQUAL( 2200.0   , fv(cash_flows + 0, cash_flows + 3,  1.0 ));
+    // Consequently:
+    LMI_TEST_EQUAL(0.25, irr(cash_flows, 3 + cash_flows,  882.8125, 5));
+    LMI_TEST_EQUAL(1.0 , irr(cash_flows, 3 + cash_flows, 2200.0   , 5));
 
     LMI_TEST_EQUAL(    0.0   , fv(cash_flows + 0, cash_flows + 4, -1.0 ));
     LMI_TEST_EQUAL(-4800.0   , fv(cash_flows + 0, cash_flows + 4,  0.0 ));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]