lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 6d6526f 1/4: Increase exactness of a unit tes


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6d6526f 1/4: Increase exactness of a unit test [385]
Date: Wed, 14 Feb 2018 20:34:06 -0500 (EST)

branch: master
commit 6d6526fd6a769431c85859bfcd29058b13787d93
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Increase exactness of a unit test [385]
    
    Restored the original, tighter tolerance, which worked at some point
    before the lmi epoch, and now works again. The problem presumably was
    numerical imprecision of some older versions of MinGW gcc.
---
 financial_test.cpp | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/financial_test.cpp b/financial_test.cpp
index f6de5b5..824a914 100644
--- a/financial_test.cpp
+++ b/financial_test.cpp
@@ -70,21 +70,7 @@ int test_main(int, char*[])
     std::vector<double> results(p.size());
     irr(p.begin(), p.end(), b.begin(), results.begin(), 5);
 
-/* TODO ?? Reconsider:
-
-Formerly, we used this tolerance:
     double const tolerance = 0.000005;
-but the algorithm is good only to within double that tolerance.
-Consider making it find irr to within that undoubled tolerance.
-
-std::cout << std::setprecision(12);
-std::cout << "results[0]: " << results[0] << '\n';
-std::cout << "99.00000 - results[ 0]: " << (99.00000 - results[ 0]) << '\n';
-std::cout << "std::fabs(99.00000 - results[ 0]): " << std::fabs(99.00000 - 
results[ 0]) << '\n';
-std::cout << "tolerance = .000005: " << .000005 << '\n';
-*/
-
-    double const tolerance = 0.000010;
 
     BOOST_TEST(std::fabs(99.00000 - results[ 0]) <= tolerance);
     BOOST_TEST(std::fabs(12.17744 - results[ 1]) <= tolerance);



reply via email to

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