[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}
- [lmi-commits] [lmi] valyuta/007 updated (0b887792 -> d223b55a), Greg Chicares, 2022/04/20
- [lmi-commits] [lmi] valyuta/007 4ae9e8fd 2/7: Change several more ledger fields to cents, Greg Chicares, 2022/04/20
- [lmi-commits] [lmi] valyuta/007 2cbd2ea4 3/7: Change several more ledger fields to cents, Greg Chicares, 2022/04/20
- [lmi-commits] [lmi] valyuta/007 d223b55a 7/7: Record speed measurements, Greg Chicares, 2022/04/20
- [lmi-commits] [lmi] valyuta/007 dc72a957 5/7: Document, suppress, or expunge unused formats, Greg Chicares, 2022/04/20
- [lmi-commits] [lmi] valyuta/007 ceaeb99d 6/7: Change one last ledger field to cents,
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/007 0c6db285 1/7: Change several more ledger fields to cents, Greg Chicares, 2022/04/20
- [lmi-commits] [lmi] valyuta/007 e351a5c4 4/7: Change several more ledger fields to cents, Greg Chicares, 2022/04/20