lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/007 ceaeb99d 6/7: Change one last ledger fie


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/007 ceaeb99d 6/7: Change one last ledger field to cents
Date: Wed, 20 Apr 2022 20:05:05 -0400 (EDT)

branch: valyuta/007
commit ceaeb99d940d5f3c9b9e57788a9562692b2ba4d5
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Change one last ledger field to cents
    
    This is the last field to be changed in this cycle. Before these
    changes, this command:
      git grep 'ariantValues().*=.*dblize'
    found 59 matches; now it finds none.
    
    This matters for several reasons. An immediate practical benefit is that
    system-test output is easier to compare, e.g.:
         d i f f i c u l t        easy
      1886.50999999999999091 --> 188651
      2034.63000000000010914 --> 203463
      2193.38999999999987267 --> 219339
    Incidentally, it uses less space:
      $du -bc /opt/lmi/test/*.test |grep 'total$'
      115816293       total
      $du -bc /opt/lmi/touchstone/*.test |grep 'total$'
      139046450       total
    Aesthetically, it was simply ugly to turn an exact integer like 188651
    (cents) into an inexact decimal like 1886.50999999999999091 dollars;
    worse, 32- and 64-bit builds often emitted different inexact values.
    And the next commit will demonstrate a performance benefit.
---
 ihs_acctval.cpp      | 2 +-
 ledger_evaluator.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index 3db369aa..4751abec 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -1234,7 +1234,7 @@ void AccountValue::FinalizeYear()
     VariantValues().CSVNet      [Year] = centize(csv_net);
     VariantValues().CV7702      [Year] = centize(cv_7702);
 
-    InvariantValues().Dcv       [Year] = dblize(Dcv);
+    InvariantValues().Dcv       [Year] = centize(Dcv);
 
     // Update death benefit. 'DBReflectingCorr' currently equals the
     // death benefit as of the beginning of the twelfth month, but its
diff --git a/ledger_evaluator.cpp b/ledger_evaluator.cpp
index b2cbac78..94e8ae3d 100644
--- a/ledger_evaluator.cpp
+++ b/ledger_evaluator.cpp
@@ -629,7 +629,7 @@ format_map_t static_formats()
     ,{"Composite"                       , f1}
     ,{"DacTaxLoad"                      , f1}
     ,{"DacTaxRsv"                       , f1}
-    ,{"Dcv"                             , f1}
+    ,{"Dcv"                             , f5}
     ,{"DeathProceedsPaid"               , f1}
     ,{"EOYDeathBft"                     , f5}
     ,{"EeGrossPmt"                      , f5}



reply via email to

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