[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 2fcea50 1/7: Resolve gratuitous differences f
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 2fcea50 1/7: Resolve gratuitous differences from valyuta/005 |
Date: |
Wed, 27 Jan 2021 20:57:45 -0500 (EST) |
branch: master
commit 2fcea50236d4e745877d3867d6a0b16c4ca1f805
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Resolve gratuitous differences from valyuta/005
---
accountvalue.cpp | 5 +++--
ihs_acctval.cpp | 4 ++++
ihs_avmly.cpp | 41 ++++++++++++++++++++++++-----------------
outlay.cpp | 8 ++++----
4 files changed, 35 insertions(+), 23 deletions(-)
diff --git a/accountvalue.cpp b/accountvalue.cpp
index e7092d4..c8d3419 100644
--- a/accountvalue.cpp
+++ b/accountvalue.cpp
@@ -545,6 +545,7 @@ void AccountValue::TxOptionChange()
alarum() << "Case " << YearsDBOpt << " not found." << LMI_FLUSH;
}
}
+ // AV normally rounded to cents, but specamt perhaps to dollars.
ActualSpecAmt = round_specamt().c(ActualSpecAmt);
// Carry the new spec amt forward into all future years.
@@ -801,7 +802,7 @@ void AccountValue::TxSetRiderDed()
AdbCharge = C0;
if(hasadb)
{
- AdbCharge = round_rider_charges().c
+ AdbCharge = round_rider_charges().c
( YearsAdbRate
// IHS !! Icky manifest constant--lmi uses a database entity.
* std::min(from_cents(50000000), ActualSpecAmt)
@@ -970,7 +971,7 @@ void AccountValue::TxTakeLoan()
// If maximum exceeded...limit it.
// IHS !! For solves, the lmi branch uses an 'ullage' concept.
double max_loan =
- AVUnloaned * 0.9 // IHS !! Icky manifest constant--lmi uses a
database entity.
+ AVUnloaned * 0.9 // IHS !! Icky manifest constant--lmi uses a
database entity.
// - surrchg
+ dblize(AVRegLn + AVPrfLn)
- RegLnBal * (std::pow((1.0 + YearsRegLnIntDueRate), 12 - Month) - 1.0)
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index d248905..96816d5 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -145,6 +145,7 @@ AccountValue::AccountValue(Input const& input)
currency AccountValue::base_specamt(int year) const
{
+ // CURRENCY !! Cents in ledger will make rounding unnecessary.
return round_specamt().c(InvariantValues().SpecAmt[year]);
}
@@ -152,6 +153,7 @@ currency AccountValue::base_specamt(int year) const
currency AccountValue::term_specamt(int year) const
{
+ // CURRENCY !! Cents in ledger will make rounding unnecessary.
return round_specamt().c(InvariantValues().TermSpecAmt[year]);
}
@@ -643,6 +645,7 @@ void AccountValue::SetInitialValues()
HoneymoonActive = false;
// Identity element for std::max(), disregarding -INF and NaN.
+ // CURRENCY !! support infinities?
#if defined USE_CURRENCY_CLASS
HoneymoonValue =
-from_cents(std::numeric_limits<currency::data_type>::max());
#else // !defined USE_CURRENCY_CLASS
@@ -1133,6 +1136,7 @@ void AccountValue::SetProjectedCoiCharge()
TxSetDeathBft();
TxSetTermAmt();
+ // CURRENCY !! presumably material_difference() isn't needed at all?
um...yes, it is
double this_years_terminal_naar = material_difference
(dblize(DBReflectingCorr + TermDB)
,dblize(TotalAccountValue())
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 5b18084..6c23b08 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -158,6 +158,9 @@ void AccountValue::DoMonthDR()
,YearsTotLoadExcLowestPremtax
,dblize(kludge_account_value)
);
+// TAXATION !! Should round here, but need to investigate regressions.
+// max_necessary_premium = round_max_premium()(max_necessary_premium);
+ // CURRENCY !! already rounded by class Irc7702A--appropriately?
double max_non_mec_premium = Irc7702A_->MaxNonMecPremium
(Dcv
,dblize(AnnualTargetPrem)
@@ -203,12 +206,14 @@ void AccountValue::DoMonthDR()
}
// CURRENCY !! currency is immune to catastrophic cancellation
double necessary_premium = std::min
+ // CURRENCY !! Wouldn't simple subtraction do, for currency?
(material_difference
(dblize(GrossPmts[Month])
,dblize(gross_1035)
)
,max_necessary_premium
);
+ // CURRENCY !! Wouldn't simple subtraction do, for currency?
double unnecessary_premium = material_difference
(dblize(GrossPmts[Month])
,dblize(gross_1035) + necessary_premium
@@ -338,7 +343,7 @@ void AccountValue::process_payment(currency payment)
// portions of unloaned account value according to input allocations.
void AccountValue::IncrementAVProportionally(currency increment)
{
- increment = round_minutiae().c(increment);
+ increment = round_minutiae().c(increment); // CURRENCY !! already rounded?
currency genacct_increment = round_minutiae().c(increment *
GenAcctPaymentAllocation);
AVGenAcct += genacct_increment;
AVSepAcct += increment - genacct_increment;
@@ -1137,6 +1142,7 @@ void AccountValue::TxTestGPT()
);
}
+ // CURRENCY !! already rounded by class Irc7702--appropriately?
GptForceout = round_minutiae().c(Irc7702_->Forceout());
// TODO ?? TAXATION !! On other bases, nothing is forced out, and payments
aren't limited.
process_distribution(GptForceout);
@@ -1901,25 +1907,25 @@ void AccountValue::TxSetRiderDed()
(
YearsWpRate
* (
- CoiCharge
- + MonthsPolicyFees
- + SpecAmtLoad
- + AdbCharge
- + SpouseRiderCharge
- + ChildRiderCharge
- + TermCharge
+ CoiCharge
+ + MonthsPolicyFees
+ + SpecAmtLoad
+ + AdbCharge
+ + SpouseRiderCharge
+ + ChildRiderCharge
+ + TermCharge
)
);
DcvWpCharge =
YearsWpRate
* (
DcvCoiCharge
- + dblize(
- MonthsPolicyFees
- + SpecAmtLoad
- + AdbCharge
- + SpouseRiderCharge
- + ChildRiderCharge
+ + dblize
+ ( MonthsPolicyFees
+ + SpecAmtLoad
+ + AdbCharge
+ + SpouseRiderCharge
+ + ChildRiderCharge
)
+ DcvTermCharge
);
@@ -2066,6 +2072,7 @@ void AccountValue::TxTakeSepAcctLoad()
}
SepAcctLoad = round_interest_credit().c(YearsSepAcctLoadRate * AVSepAcct);
+ // CURRENCY !! Does this seem right? Mightn't it take a sepacct load from
the genacct?
process_deduction(SepAcctLoad);
YearsTotalSepAcctLoad += SepAcctLoad;
Dcv -= dblize(SepAcctLoad);
@@ -2360,9 +2367,9 @@ void AccountValue::SetMaxWD()
{
MaxWD =
round_withdrawal().c
- ( AVGenAcct * MaxWdGenAcctValMult
- + AVSepAcct * MaxWdSepAcctValMult
- )
+ ( AVGenAcct * MaxWdGenAcctValMult
+ + AVSepAcct * MaxWdSepAcctValMult
+ )
+ (AVRegLn + AVPrfLn)
- (RegLnBal + PrfLnBal)
- anticipated_deduction(MaxWDDed_)
diff --git a/outlay.cpp b/outlay.cpp
index cbd9018..ebbdd47 100644
--- a/outlay.cpp
+++ b/outlay.cpp
@@ -61,25 +61,25 @@ void modal_outlay::set_internal_1035_amount(currency z)
void modal_outlay::set_ee_modal_premiums(currency z, int from_year, int
to_year)
{
- z = round_gross_premium_.c(z);
+ z = round_gross_premium_.c(z); // CURRENCY !! already rounded?
std::fill_n(ee_modal_premiums_.begin() + from_year, to_year - from_year,
z);
}
void modal_outlay::set_er_modal_premiums(currency z, int from_year, int
to_year)
{
- z = round_gross_premium_.c(z);
+ z = round_gross_premium_.c(z); // CURRENCY !! already rounded?
std::fill_n(er_modal_premiums_.begin() + from_year, to_year - from_year,
z);
}
void modal_outlay::set_er_modal_premiums(std::vector<currency> const& z)
{
LMI_ASSERT(z.size() == er_modal_premiums_.size());
- er_modal_premiums_ = round_gross_premium_.c(z);
+ er_modal_premiums_ = round_gross_premium_.c(z); // CURRENCY !! already
rounded?
}
void modal_outlay::set_withdrawals(currency z, int from_year, int to_year)
{
- z = round_withdrawal_.c(z);
+ z = round_withdrawal_.c(z); // CURRENCY !! already rounded?
std::fill_n(withdrawals_.begin() + from_year, to_year - from_year, z);
}
- [lmi-commits] [lmi] master updated (fa7b681 -> e0ea157), Greg Chicares, 2021/01/27
- [lmi-commits] [lmi] master 0e44701 3/7: Rework maximum-loan calculation, Greg Chicares, 2021/01/27
- [lmi-commits] [lmi] master 53165eb 4/7: Reorder independent statements for clarity, Greg Chicares, 2021/01/27
- [lmi-commits] [lmi] master 2fcea50 1/7: Resolve gratuitous differences from valyuta/005,
Greg Chicares <=
- [lmi-commits] [lmi] master e0ea157 7/7: Switch to currency class, Greg Chicares, 2021/01/27
- [lmi-commits] [lmi] master 6c85726 2/7: Reformat, Greg Chicares, 2021/01/27
- [lmi-commits] [lmi] master f9b937f 5/7: Round increments and decrements better, Greg Chicares, 2021/01/27
- [lmi-commits] [lmi] master 8c0f4d8 6/7: Record speed measurements, Greg Chicares, 2021/01/27