lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 1f8316c 16/22: Test actual return value


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 1f8316c 16/22: Test actual return value
Date: Sun, 6 Jun 2021 21:38:02 -0400 (EDT)

branch: master
commit 1f8316ceadd9b129e9eccac203bbdf5c49222880
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Test actual return value
    
    If a function calculates an intermediate value x and returns f(x), and
    it is desired to test the return value, then test f(x) rather than x.
---
 ihs_avsolve.cpp | 2 +-
 solve.cpp       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index c6c5e77..ed076be 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -475,7 +475,7 @@ currency AccountValue::Solve
             break;
         case root_not_bracketed:
             {
-            LMI_ASSERT(0.0 == solution.root);
+            LMI_ASSERT(C0 == solution_cents);
             // Don't want this firing continually in census runs.
             if(!SolvingForGuarPremium)
                 {
diff --git a/solve.cpp b/solve.cpp
index 0a0f60d..eff08a0 100644
--- a/solve.cpp
+++ b/solve.cpp
@@ -354,7 +354,7 @@ currency AccountValue::Solve()
             break;
         case root_not_bracketed:
             {
-            LMI_ASSERT(0.0 == solution.root);
+            LMI_ASSERT(C0 == solution_cents);
             warning() << "solution not found. Using zero instead." << 
LMI_FLUSH;
             }
             break;



reply via email to

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