lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/004 0c93fc2 02/11: Fix a problem somewhat my


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/004 0c93fc2 02/11: Fix a problem somewhat mystically
Date: Sun, 20 Dec 2020 17:40:08 -0500 (EST)

branch: valyuta/004
commit 0c93fc202fa9dd7c32c4aff9f2a78cbbff62d4a3
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Fix a problem somewhat mystically
    
    An assertion had failed, even though that seemed impossible. Displaying
    the values of the quantities that it asserted to be equal prevented the
    assertion from failing; but they were displayed only when the assertion
    would have failed, yet that failure was prevented by displaying the
    values. Attempts to reproduce the problem in a simple standalone test
    case were unsuccessful.
    
    The input class stores the solve target value from the input class as a
    double. Formerly, a target such as $1.23 was converted to 123¢, though
    of course it was really something like 1.23000001 and was converted to
    123.000001 when it should have been rounded. Now, it's rounded to 123¢,
    with an underlying (double) value of exactly 123.
    
    Correcting that actual defect caused the mysterious assertion failure
    to vanish. This being a casual branch, we grit our teeth and declare
    victory. The assertion is peculiar anyway: it occurs seven times in this
    TU, and clearly should never fail, yet it's been around for decades, and
    it was obviously written for some reason.
---
 ihs_acctval.cpp |  2 +-
 ihs_avmly.cpp   | 10 ----------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index aba0680..41c9e01 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -290,7 +290,7 @@ void AccountValue::RunAllApplicableBases()
             ,yare_input_.SolveBeginYear
             ,yare_input_.SolveEndYear
             ,yare_input_.SolveTarget
-            ,currency(yare_input_.SolveTargetValue)
+            ,round_minutiae().c(yare_input_.SolveTargetValue)
             ,yare_input_.SolveTargetYear
             ,yare_input_.SolveExpenseGeneralAccountBasis
             ,yare_input_.SolveSeparateAccountBasis
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index d831b96..789c737 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -1285,16 +1285,6 @@ void AccountValue::TxAscertainDesiredPayment()
         }
 
 //  if(!(materially_equal(GrossPmts[Month], EeGrossPmts[Month] + 
ErGrossPmts[Month])))
-    if(GrossPmts[Month] != EeGrossPmts[Month] + ErGrossPmts[Month])
-        warning()
-            << GrossPmts[Month] << " GrossPmts[Month]\n"
-            << EeGrossPmts[Month] + ErGrossPmts[Month] << " EeGrossPmts[Month] 
+ ErGrossPmts[Month]\n"
-            << EeGrossPmts[Month] << " EeGrossPmts[Month]\n"
-            << ErGrossPmts[Month] << " ErGrossPmts[Month]\n"
-            << Year << " Year\n"
-            << Month << " Month\n"
-            << LMI_FLUSH
-            ;
 //  LMI_ASSERT(materially_equal(GrossPmts[Month], EeGrossPmts[Month] + 
ErGrossPmts[Month]));
     LMI_ASSERT(GrossPmts[Month] == EeGrossPmts[Month] + ErGrossPmts[Month]);
 }



reply via email to

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