lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master fa7b681 3/3: Cautiously preserve some weird l


From: Greg Chicares
Subject: [lmi-commits] [lmi] master fa7b681 3/3: Cautiously preserve some weird logic
Date: Wed, 27 Jan 2021 02:57:18 -0500 (EST)

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

    Cautiously preserve some weird logic
---
 ihs_avmly.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 0c1bd68..5b18084 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -2190,8 +2190,16 @@ void AccountValue::TxCreditInt()
         currency gross = InterestCredited(AVSepAcct, gross_sep_acct_rate);
         notional_sep_acct_charge = gross - SepAcctIntCred;
 #if defined USE_CURRENCY_CLASS
-        // CURRENCY !! too cavalier?
-        AVSepAcct += SepAcctIntCred;
+        currency result = AVSepAcct + SepAcctIntCred;
+        // CURRENCY !! rethink this weird logic
+        if(result < C0 && C0 <= AVSepAcct)
+            {
+            AVSepAcct = C0;
+            }
+        else
+            {
+            AVSepAcct = result;
+            }
 #else  // !defined USE_CURRENCY_CLASS
         // Guard against catastrophic cancellation. Testing the
         // absolute values of the addends for material equality is not



reply via email to

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