lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master e360e0d 07/10: Add some commentary on a marke


From: Greg Chicares
Subject: [lmi-commits] [lmi] master e360e0d 07/10: Add some commentary on a marked defect
Date: Fri, 4 Sep 2020 21:16:10 -0400 (EDT)

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

    Add some commentary on a marked defect
    
    The root cause of this problem is probably that ledger objects are used
    to hold evanescent state of class AccountValue. Ideally they would be
    treated as write-only storage for output values.
---
 ihs_avmly.cpp | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index af8d465..fa959ae 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -962,24 +962,34 @@ void AccountValue::TxSpecAmtChange()
 {
     if(0 != Month || 0 == Year)
         {
-        // What needful thing does this accomplish?
-        // Set option 2 death benefit, e.g.?
-
 // > This initializes DBReflectingCorr and others so that the at-issue but
 // > post-1035 exchange calculation of the seven pay will have a death benefit
 // > amount to base its calculations on.
-//
-// TODO ?? We should find a better way. The original intention of this block
-// was to return immediately without doing anything at all except on renewal
-// anniversaries, because elective spec amt changes are not allowed at the
-// issue date or in any off-anniversary month. The line added to change the
-// specified amount by zero is executed almost every month. The call is costly
-// and very probably superfluous. It is probably one reason why calculations
-// are so slow when the term rider is present. ChangeSpecAmtBy() was designed
-// to be called only when the spec amt changes; calling it with an argument
-// of zero is a rather bizarre concept.
-
+#if 1
         ChangeSpecAmtBy(0.0);
+#else // 0
+        // TODO ?? Changing specamt by zero is absurd. The following
+        // commented-out alternative seems to do the same thing as
+        // the line above--at least the regression test succeeds.
+        // However, both ways are unclean, and both may be incorrect.
+        //
+        // Carry specamt forward into all future years.
+        for(int j = Year; j < BasicValues::GetLength(); ++j)
+            {
+            ActualSpecAmt = std::max
+                (ActualSpecAmt
+                ,minimum_specified_amount(0 == Year && 0 == Month, 
TermRiderActive)
+                );
+            ActualSpecAmt = round_specamt()(ActualSpecAmt);
+            InvariantValues().SpecAmt[j] = ActualSpecAmt;
+            if(!TermIsNotRider)
+                {
+                InvariantValues().TermSpecAmt[j] = TermSpecAmt;
+                }
+            }
+        // Set BOM DB for 7702 and 7702A.
+        TxSetDeathBft();
+#endif // 0
         return;
         }
 



reply via email to

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