[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] valyuta/002 d7fcd48 1/5: Write zero cents more terse
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] valyuta/002 d7fcd48 1/5: Write zero cents more tersely |
Date: |
Sun, 20 Sep 2020 12:55:17 -0400 (EDT) |
branch: valyuta/002
commit d7fcd483b50c40506017be111d1a4fa0f9812674
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Write zero cents more tersely
When zero is wanted, write "currency()" never, "{}" where it works,
and a shorthand "C0" elsewhere. This makes invocations of non-default
currency ctors easier to identify, which is important because some of
them were written with too little thought just to get this branch to
compile.
---
accountvalue.cpp | 46 ++++++-------
currency.hpp | 10 +++
currency_test.cpp | 3 +
gpt_specamt.cpp | 2 +-
ihs_acctval.cpp | 122 ++++++++++++++++-----------------
ihs_avdebug.cpp | 2 +-
ihs_avmly.cpp | 198 +++++++++++++++++++++++++++---------------------------
ihs_avsolve.cpp | 6 +-
ihs_basicval.cpp | 4 +-
solve.cpp | 2 +-
10 files changed, 204 insertions(+), 191 deletions(-)
diff --git a/accountvalue.cpp b/accountvalue.cpp
index ca23075..07b72da 100644
--- a/accountvalue.cpp
+++ b/accountvalue.cpp
@@ -234,13 +234,13 @@ currency AccountValue::RunOneCell(mcenum_run_basis
TheBasis)
LapseMonth = 0;
LapseYear = 0;
- TaxBasis = currency();
+ TaxBasis = {};
- MaxLoan = currency();
- RegLnBal = currency();
- PrfLnBal = currency();
- AVRegLn = currency();
- AVPrfLn = currency();
+ MaxLoan = {};
+ RegLnBal = {};
+ PrfLnBal = {};
+ AVRegLn = {};
+ AVPrfLn = {};
// 'InforceAVGenAcct' is unloaned only; this branch wasn't
// designed to allow inforce loans.
@@ -331,8 +331,8 @@ void AccountValue::DoYear
YearsCorridorFactor = BasicValues::GetCorridorFactor()[Year];
- GrossPmts .assign(12, currency());
- NetPmts .assign(12, currency());
+ GrossPmts .assign(12, {});
+ NetPmts .assign(12, {});
// IHS !! Strategy here?
@@ -354,7 +354,7 @@ void AccountValue::DoYear
VariantValues().EOYDeathBft[Year] = deathbft.d();
// IHS !! Change one of these names, which differ only in the terminal 's'.
- InvariantValues().GrossPmt[Year] += std::accumulate(GrossPmts.begin(),
GrossPmts.end(), currency()).d();
+ InvariantValues().GrossPmt[Year] += std::accumulate(GrossPmts.begin(),
GrossPmts.end(), C0).d();
InvariantValues().Outlay[Year] =
InvariantValues().GrossPmt [Year]
- InvariantValues().NetWD [Year]
@@ -523,7 +523,7 @@ void AccountValue::TxOptionChange()
// Nothing to do unless AV is positive.
currency AV = AVUnloaned + AVRegLn + AVPrfLn;
- if(AV <= currency())
+ if(AV <= C0)
{
return;
}
@@ -727,7 +727,7 @@ void AccountValue::TxLoanRepay()
}
// Nothing to do if no loan repayment requested.
- if(currency() <= RequestedLoan)
+ if(C0 <= RequestedLoan)
{
return;
}
@@ -766,7 +766,7 @@ void AccountValue::TxSetDeathBft()
// Option 2: specamt plus AV, or corridor times AV if greater.
// Negative AV doesn't decrease death benefit.
deathbft = std::max
- (ActualSpecAmt + std::max(currency(), AV)
+ (ActualSpecAmt + std::max({}, AV)
,corr
);
break;
@@ -800,7 +800,7 @@ void AccountValue::TxSetCoiCharge()
void AccountValue::TxSetRiderDed()
{
- WpCharge = currency();
+ WpCharge = {};
if(haswp)
{
WpCharge = currency
@@ -810,7 +810,7 @@ void AccountValue::TxSetRiderDed()
);
}
- AdbCharge = currency();
+ AdbCharge = {};
if(hasadb)
{
AdbCharge = currency(YearsAdbRate * std::min(500000.0,
ActualSpecAmt.d()));
@@ -832,14 +832,14 @@ void AccountValue::TxCreditInt()
{
// Accrue interest on unloaned and loaned account value separately,
// but do not charge interest on negative account value.
- if(currency() < AVUnloaned)
+ if(C0 < AVUnloaned)
{
// IHS !! Each interest increment is rounded separately in lmi.
currency z = round_interest_credit().c(AVUnloaned *
YearsGenAcctIntRate);
AVUnloaned += z;
}
// Loaned account value cannot be negative.
- LMI_ASSERT(currency() <= AVRegLn + AVPrfLn);
+ LMI_ASSERT(C0 <= AVRegLn + AVPrfLn);
}
/// Accrue loan interest, and calculate interest credit on loaned AV.
@@ -847,7 +847,7 @@ void AccountValue::TxCreditInt()
void AccountValue::TxLoanInt()
{
// Nothing to do if there's no loan outstanding.
- if(currency() == RegLnBal && currency() == PrfLnBal)
+ if(C0 == RegLnBal && C0 == PrfLnBal)
{
return;
}
@@ -881,7 +881,7 @@ void AccountValue::TxTakeWD()
}
// Nothing to do if no withdrawal requested.
- if(currency() == wd)
+ if(C0 == wd)
{
return;
}
@@ -891,7 +891,7 @@ void AccountValue::TxTakeWD()
// Impose minimum amount (if nonzero) on withdrawals.
if(wd < MinWD)
{
- wd = currency();
+ wd = {};
}
// Impose maximum amount.
@@ -970,7 +970,7 @@ void AccountValue::TxTakeLoan()
}
// Nothing to do if no loan requested.
- if(RequestedLoan <= currency())
+ if(RequestedLoan <= C0)
{
return;
}
@@ -1024,7 +1024,7 @@ void AccountValue::TxTestLapse()
// Otherwise if AV is negative or if overloaned, then lapse the policy.
else if
(
- (AVUnloaned + AVRegLn + AVPrfLn < currency())
+ (AVUnloaned + AVRegLn + AVPrfLn < C0)
|| (MaxLoan < RegLnBal + PrfLnBal)
)
{
@@ -1067,9 +1067,9 @@ double AccountValue::GetCurtateNetCoiChargeInforce() const
double AccountValue::GetProjectedCoiChargeInforce() const
{return 0.0;}
currency AccountValue::GetSepAcctAssetsInforce() const
- {return currency();}
+ {return {};}
currency AccountValue::IncrementBOM(int, int, double)
- {return currency();}
+ {return {};}
void AccountValue::IncrementEOM(int, int, currency, currency)
{return;}
void AccountValue::IncrementEOY(int)
diff --git a/currency.hpp b/currency.hpp
index c5d7899..c843446 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -185,6 +185,16 @@ inline std::vector<double> doubleize(std::vector<currency>
const& z)
return r;
}
+/// Zero cents--akin to a user-defined literal.
+///
+/// UDLs seem less convenient because the obvious "0_c" is likely to
+/// collide with some other UDL, and "currency::0_c" is too verbose.
+/// "0_cents" may avoid both those problems, but "C0" is terser.
+/// "C0" is chosen instead of "c0" only for the pixilated reason that
+/// the capital letter looks kind of like a "0".
+
+inline constexpr currency C0 = {};
+
#if !defined CURRENCY_HAS_INTEGER_DATATYPE
# if defined __GNUC__
# pragma GCC diagnostic pop
diff --git a/currency_test.cpp b/currency_test.cpp
index 0224b03..a91e572 100644
--- a/currency_test.cpp
+++ b/currency_test.cpp
@@ -61,6 +61,9 @@ void currency_test::test_something()
currency a2 = currency() - a1;
BOOST_TEST(-6.50 == a2.d());
BOOST_TEST( -650 == a2.m_);
+ a2 = C0 - a1;
+ BOOST_TEST(-6.50 == a2.d());
+ BOOST_TEST( -650 == a2.m_);
a2 = -a1;
BOOST_TEST(-6.50 == a2.d());
BOOST_TEST( -650 == a2.m_);
diff --git a/gpt_specamt.cpp b/gpt_specamt.cpp
index bcf0ba1..e2b9c11 100644
--- a/gpt_specamt.cpp
+++ b/gpt_specamt.cpp
@@ -139,7 +139,7 @@ currency gpt_specamt::CalculateSpecAmt
,double a_NetPmtFactorExc
)
{
- LMI_ASSERT(currency() != a_Premium);
+ LMI_ASSERT(C0 != a_Premium);
LMI_ASSERT(0.0 != a_NetPmtFactorTgt);
LMI_ASSERT(0.0 != a_NetPmtFactorExc);
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index e8bc719..1b383e8 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -109,18 +109,18 @@ AccountValue::AccountValue(Input const& input)
// Explicitly initialize antediluvian members. It's generally
// better to do this in the initializer-list, but here they can
// all be kept together.
- LapseMonth = 0; // Antediluvian.
- LapseYear = 0; // Antediluvian.
- AVUnloaned = currency(); // Antediluvian.
- pmt = currency(); // Antediluvian.
+ LapseMonth = {}; // Antediluvian.
+ LapseYear = {}; // Antediluvian.
+ AVUnloaned = {}; // Antediluvian.
+ pmt = {}; // Antediluvian.
pmt_mode = mce_annual; // Antediluvian.
- ModeIndex = 0; // Antediluvian.
- wd = currency(); // Antediluvian.
- mlyguarv = 0.0; // Antediluvian.
- deathbft = currency(); // Antediluvian.
+ ModeIndex = {}; // Antediluvian.
+ wd = {}; // Antediluvian.
+ mlyguarv = {}; // Antediluvian.
+ deathbft = {}; // Antediluvian.
haswp = false; // Antediluvian.
hasadb = false; // Antediluvian.
- mlydedtonextmodalpmtdate = currency(); // Antediluvian.
+ mlydedtonextmodalpmtdate = {} ; // Antediluvian.
set_list_bill_year_and_month();
@@ -158,7 +158,7 @@ currency AccountValue::specamt_for_7702(int year) const
{
return
base_specamt(year)
- + (TermIsDbFor7702 ? term_specamt(year) : currency())
+ + (TermIsDbFor7702 ? term_specamt(year) : C0)
;
}
@@ -168,7 +168,7 @@ currency AccountValue::specamt_for_7702A(int year) const
{
return
base_specamt(year)
- + (TermIsDbFor7702A ? term_specamt(year) : currency())
+ + (TermIsDbFor7702A ? term_specamt(year) : C0)
;
}
@@ -217,7 +217,7 @@ Then run other bases.
// this rather expensive function.
void AccountValue::SetGuarPrem()
{
- GuarPremium = currency();
+ GuarPremium = {};
if(BasicValues::IsSubjectToIllustrationReg())
{
GuarPremium = SolveGuarPremium();
@@ -399,7 +399,7 @@ void AccountValue::InitializeLife(mcenum_run_basis a_Basis)
// TODO ?? TAXATION !! Shouldn't we increase initial SA if contract in
corridor at issue?
OldDB = OldSA;
- SurrChg_.assign(BasicValues::GetLength(), currency());
+ SurrChg_.assign(BasicValues::GetLength(), {});
// TAXATION !! Input::InforceAnnualTargetPremium should be used here.
double annual_target_premium = GetModalTgtPrem
@@ -435,9 +435,9 @@ void AccountValue::InitializeLife(mcenum_run_basis a_Basis)
InvariantValues().InforceIsMec = inforce_is_mec;
bool mec_1035 =
yare_input_.External1035ExchangeFromMec
- && currency() != Outlay_->external_1035_amount()
+ && C0 != Outlay_->external_1035_amount()
|| yare_input_.Internal1035ExchangeFromMec
- && currency() != Outlay_->internal_1035_amount()
+ && C0 != Outlay_->internal_1035_amount()
;
bool is_already_a_mec = inforce_is_mec || mec_1035;
if(is_already_a_mec)
@@ -531,7 +531,7 @@ void AccountValue::SetInitialValues()
Month = InforceMonth;
CoordinateCounters();
- DB7702A = currency(); // TODO ?? TAXATION !! This seems
silly.
+ DB7702A = {}; // TODO ?? TAXATION !! This seems silly.
AVRegLn = round_minutiae().c(InforceAVRegLn);
AVPrfLn = round_minutiae().c(InforceAVPrfLn);
@@ -563,28 +563,28 @@ void AccountValue::SetInitialValues()
;
}
- MaxLoan = currency();
+ MaxLoan = {};
- GenAcctIntCred = currency();
- SepAcctIntCred = currency();
- RegLnIntCred = currency();
- PrfLnIntCred = currency();
+ GenAcctIntCred = {};
+ SepAcctIntCred = {};
+ RegLnIntCred = {};
+ PrfLnIntCred = {};
- MaxWD = currency();
- GrossWD = currency();
- NetWD = currency();
+ MaxWD = {};
+ GrossWD = {};
+ NetWD = {};
CumPmts = InforceCumPmts;
TaxBasis = InforceTaxBasis;
- YearlyTaxBasis.assign(BasicValues::GetLength(), currency());
- MlyNoLapsePrem = currency();
+ YearlyTaxBasis.assign(BasicValues::GetLength(), {});
+ MlyNoLapsePrem = {};
CumNoLapsePrem = InforceCumNoLapsePrem;
// Initialize all elements of this vector to 'false'. Then, when
// the no-lapse criteria fail to be met, future values are right.
YearlyNoLapseActive.assign(BasicValues::GetLength(), false);
- loan_ullage_ .assign(BasicValues::GetLength(), currency());
- withdrawal_ullage_ .assign(BasicValues::GetLength(), currency());
+ loan_ullage_ .assign(BasicValues::GetLength(), {});
+ withdrawal_ullage_ .assign(BasicValues::GetLength(), {});
NoLapseActive = true;
if(NoLapseDboLvlOnly && mce_option1 != DeathBfts_->dbopt()[0])
{
@@ -600,7 +600,7 @@ void AccountValue::SetInitialValues()
database().query_into(DB_TermCanLapse , TermCanLapse);
TermRiderActive = true;
- TermDB = currency();
+ TermDB = {};
ItLapsed = false;
@@ -634,10 +634,10 @@ void AccountValue::SetInitialValues()
}
}
- CoiCharge = currency();
- RiderCharges = currency();
- NetCoiCharge = currency();
- MlyDed = currency();
+ CoiCharge = {};
+ RiderCharges = {};
+ NetCoiCharge = {};
+ MlyDed = {};
CumulativeSalesLoad =
round_minutiae().c(yare_input_.InforceCumulativeSalesLoad);
database().query_into(DB_ExpRatCoiRetention, CoiRetentionRate);
@@ -693,7 +693,7 @@ currency AccountValue::IncrementBOM
{
// Return value is total assets. After the policy has lapsed or
// matured, there are no assets.
- return currency();
+ return {};
}
// Paranoid check.
@@ -765,8 +765,8 @@ void AccountValue::IncrementEOM
// Save arguments, constraining their values to be nonnegative,
// for calculating banded and tiered quantities.
- AssetsPostBom = std::max(currency(), assets_post_bom );
- CumPmtsPostBom = std::max(currency(), cum_pmts_post_bom);
+ AssetsPostBom = std::max({}, assets_post_bom );
+ CumPmtsPostBom = std::max({}, cum_pmts_post_bom);
DoMonthCR();
}
@@ -813,29 +813,29 @@ void AccountValue::InitializeYear()
Irc7702A_->UpdateBOY7702A(Year);
}
- MonthsPolicyFees = currency();
- SpecAmtLoad = currency();
+ MonthsPolicyFees = {};
+ SpecAmtLoad = {};
- AssetsPostBom = currency();
- CumPmtsPostBom = currency();
- SepAcctLoad = currency();
+ AssetsPostBom = {};
+ CumPmtsPostBom = {};
+ SepAcctLoad = {};
- YearsTotalCoiCharge = currency();
- YearsTotalRiderCharges = currency();
+ YearsTotalCoiCharge = {};
+ YearsTotalRiderCharges = {};
YearsAVRelOnDeath = 0.0;
YearsLoanRepaidOnDeath = 0.0;
YearsGrossClaims = 0.0;
YearsDeathProceeds = 0.0;
YearsNetClaims = 0.0;
- YearsTotalNetIntCredited = currency();
- YearsTotalGrossIntCredited = currency();
- YearsTotalLoanIntAccrued = currency();
+ YearsTotalNetIntCredited = {};
+ YearsTotalGrossIntCredited = {};
+ YearsTotalLoanIntAccrued = {};
YearsTotalNetCoiCharge = 0.0;
- YearsTotalPolicyFee = currency();
+ YearsTotalPolicyFee = {};
YearsTotalDacTaxLoad = 0.0;
- YearsTotalSpecAmtLoad = currency();
- YearsTotalSepAcctLoad = currency();
- YearsTotalGptForceout = currency();
+ YearsTotalSpecAmtLoad = {};
+ YearsTotalSepAcctLoad = {};
+ YearsTotalGptForceout = {};
NextYearsProjectedCoiCharge = 0.0;
@@ -846,12 +846,12 @@ void AccountValue::InitializeYear()
// variable in each function might have sufficed, except that this
// quantity is used in the optional monthly detail report. Its
// value depends on the maximum loan, so it cannot be known here.
- ActualLoan = currency();
+ ActualLoan = {};
- GrossPmts .assign(12, currency());
- EeGrossPmts .assign(12, currency());
- ErGrossPmts .assign(12, currency());
- NetPmts .assign(12, currency());
+ GrossPmts .assign(12, {});
+ EeGrossPmts .assign(12, {});
+ ErGrossPmts .assign(12, {});
+ NetPmts .assign(12, {});
InitializeSpecAmt();
}
@@ -1008,7 +1008,7 @@ void AccountValue::set_modal_min_premium()
currency AccountValue::SurrChg() const
{
- LMI_ASSERT(currency() <= SurrChg_[Year]);
+ LMI_ASSERT(C0 <= SurrChg_[Year]);
// For the nonce, CSVBoost() is netted against surrender charge.
// This class's implementation should be revised to distinguish
// these additive and subtractive components of CSV.
@@ -1026,7 +1026,7 @@ currency AccountValue::CSVBoost() const
+ yare_input_.CashValueEnhancementRate[Year]
;
LMI_ASSERT(0.0 <= z);
- return round_minutiae().c(z * std::max(currency(), TotalAccountValue()));
+ return round_minutiae().c(z * std::max({}, TotalAccountValue()));
}
//============================================================================
@@ -1170,7 +1170,7 @@ void AccountValue::FinalizeYear()
// While performing a solve, ignore any positive surrender charge
// that cannot cause the contract to lapse.
- if(Solving && currency() < surr_chg && LapseIgnoresSurrChg)
+ if(Solving && C0 < surr_chg && LapseIgnoresSurrChg)
{
; // Do nothing.
}
@@ -1183,7 +1183,7 @@ void AccountValue::FinalizeYear()
if(!Solving)
{
- csv_net = std::max(csv_net, currency());
+ csv_net = std::max(csv_net, {});
}
if(Solving)
@@ -1201,7 +1201,7 @@ void AccountValue::FinalizeYear()
// the surrender charge are negative while others are positive,
// consider only their sum here, instead of considering the sign
// of each component individually.
- if(surr_chg < currency())
+ if(surr_chg < C0)
{
cv_7702 -= surr_chg;
}
@@ -1466,7 +1466,7 @@ currency AccountValue::GetSepAcctAssetsInforce() const
{
if(ItLapsed || BasicValues::GetLength() <= Year)
{
- return currency();
+ return {};
}
return round_minutiae().c(SepAcctValueAfterDeduction *
partial_mortality_lx()[Year]);
diff --git a/ihs_avdebug.cpp b/ihs_avdebug.cpp
index 047528b..4dee176 100644
--- a/ihs_avdebug.cpp
+++ b/ihs_avdebug.cpp
@@ -419,7 +419,7 @@ void AccountValue::DebugPrint()
SetMonthlyDetail(eCumNoLapsePrem ,CumNoLapsePrem );
SetMonthlyDetail(eNoLapseActive ,NoLapseActive );
SetMonthlyDetail(eEOMAV ,TotalAccountValue() );
- SetMonthlyDetail(eHMValue ,std::max(HoneymoonValue,
currency()));
+ SetMonthlyDetail(eHMValue ,std::max(HoneymoonValue, {}) );
SetMonthlyDetail(eSurrChg ,SurrChg() );
// TODO ?? Unfortunately duplicated from AccountValue::FinalizeYear().
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 96aba3a..b061285 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -130,8 +130,8 @@ void AccountValue::DoMonthDR()
,CashValueFor7702().d()
);
- NetPmts [Month] = currency(); // TODO ?? expunge as being unnecessary
- GrossPmts[Month] = currency(); // TODO ?? expunge as being unnecessary
+ NetPmts [Month] = {}; // TODO ?? expunge as being unnecessary
+ GrossPmts[Month] = {}; // TODO ?? expunge as being unnecessary
TxExch1035();
// TODO ?? TAXATION !! Is this where spec amt should be increased by GPT?
@@ -288,9 +288,9 @@ void AccountValue::process_payment(currency payment)
// contracts. We deem net payments to have the same proportion
// as gross payments, which we do have for ee and er separately.
- LMI_ASSERT(currency() <= GrossPmts[Month]);
- LMI_ASSERT(currency() <= EeGrossPmts[Month]);
- LMI_ASSERT(currency() <= ErGrossPmts[Month]);
+ LMI_ASSERT(C0 <= GrossPmts[Month]);
+ LMI_ASSERT(C0 <= EeGrossPmts[Month]);
+ LMI_ASSERT(C0 <= ErGrossPmts[Month]);
currency gross_1035 {};
if(0 == Year && 0 == Month)
@@ -299,7 +299,7 @@ void AccountValue::process_payment(currency payment)
}
currency gross_non_1035_pmts = GrossPmts[Month] - gross_1035;
double er_proportion = 0.0;
- if(currency() != gross_non_1035_pmts)
+ if(C0 != gross_non_1035_pmts)
{
er_proportion = ErGrossPmts[Month] / gross_non_1035_pmts.d();
}
@@ -438,8 +438,8 @@ void AccountValue::DecrementAVProportionally(currency
decrement)
// if(materially_equal(decrement, AVGenAcct + AVSepAcct))
if(decrement == AVGenAcct + AVSepAcct)
{
- AVGenAcct = currency();
- AVSepAcct = currency();
+ AVGenAcct = {};
+ AVSepAcct = {};
return;
}
@@ -502,8 +502,8 @@ void AccountValue::DecrementAVProgressively
// if(materially_equal(decrement, AVGenAcct + AVSepAcct))
if(decrement == AVGenAcct + AVSepAcct)
{
- AVGenAcct = currency();
- AVSepAcct = currency();
+ AVGenAcct = {};
+ AVSepAcct = {};
return;
}
@@ -532,16 +532,16 @@ void AccountValue::TxExch1035()
LMI_ASSERT(Year == InforceYear);
LMI_ASSERT(Month == InforceMonth);
- LMI_ASSERT(currency() == GrossPmts[Month]);
- LMI_ASSERT(currency() == EeGrossPmts[Month]);
- LMI_ASSERT(currency() == ErGrossPmts[Month]);
+ LMI_ASSERT(C0 == GrossPmts[Month]);
+ LMI_ASSERT(C0 == EeGrossPmts[Month]);
+ LMI_ASSERT(C0 == ErGrossPmts[Month]);
// Policy issue date is always a modal payment date.
GrossPmts[Month] = External1035Amount + Internal1035Amount;
// TODO ?? TAXATION !! This looks like a good idea, but it would prevent the
// initial seven-pay premium from being set.
-// if(currency() == GrossPmts[Month])
+// if(C0 == GrossPmts[Month])
// {
// return;
// }
@@ -590,11 +590,11 @@ void AccountValue::TxExch1035()
NetPmts[Month] = GrossPmts[Month] - actual_load;
- LMI_ASSERT(currency() == AVGenAcct);
- LMI_ASSERT(currency() == AVSepAcct);
+ LMI_ASSERT(C0 == AVGenAcct);
+ LMI_ASSERT(C0 == AVSepAcct);
process_payment(NetPmts[Month]);
- DBReflectingCorr = currency();
+ DBReflectingCorr = {};
TxSetDeathBft();
TxSetTermAmt();
// TODO ?? TAXATION !! Should 1035 exchanges be handled somewhere else?
@@ -610,7 +610,7 @@ void AccountValue::TxExch1035()
if(HoneymoonActive)
{
- HoneymoonValue += std::max(currency(), GrossPmts[Month]);
+ HoneymoonValue += std::max({}, GrossPmts[Month]);
}
CumPmts += GrossPmts[Month];
@@ -748,7 +748,7 @@ void AccountValue::ChangeSpecAmtBy(currency delta)
ActualSpecAmt += round_specamt().c(delta * (1.0 - term_proportion));
TermSpecAmt = old_total_specamt + delta - ActualSpecAmt;
- if(TermSpecAmt < currency())
+ if(TermSpecAmt < C0)
{
// Reducing the term rider's specified amount to a value
// less than zero is taken as a request to terminate the
@@ -819,7 +819,7 @@ void AccountValue::ChangeSupplAmtBy(currency delta)
TermSpecAmt = std::max
(TermSpecAmt
- ,currency() // No minimum other than zero is defined.
+ ,{} // No minimum other than zero is defined.
);
TermSpecAmt = round_specamt().c(TermSpecAmt); // already rounded?
// At least for now, there is no effect on surrender charges.
@@ -837,7 +837,7 @@ void AccountValue::ChangeSupplAmtBy(currency delta)
//============================================================================
void AccountValue::InitializeMonth()
{
- GptForceout = currency();
+ GptForceout = {};
premium_load_ = 0.0;
sales_load_ = 0.0;
premium_tax_load_ = 0.0;
@@ -910,18 +910,18 @@ void AccountValue::TxOptionChange()
{
if(mce_option2 == old_option)
{
- ChangeSpecAmtBy(std::max(currency(), TotalAccountValue()));
+ ChangeSpecAmtBy(std::max({}, TotalAccountValue()));
}
else if(mce_rop == old_option)
{
- ChangeSpecAmtBy(std::max(currency(), CumPmts));
+ ChangeSpecAmtBy(std::max({}, CumPmts));
}
else if(mce_mdb == old_option)
{
// Do nothing. An argument could be made for this
// alternative:
// TxSetDeathBft(); // update DBReflectingCorr
- // ChangeSpecAmtBy(std::max(currency(),
DBReflectingCorr));
+ // ChangeSpecAmtBy(std::max({}, DBReflectingCorr));
// but that takes more work and is not clearly
// preferable.
}
@@ -941,7 +941,7 @@ void AccountValue::TxOptionChange()
case mce_option2:
if(OptChgCanDecrSA)
{
- ChangeSpecAmtBy(-std::max(currency(), TotalAccountValue()));
+ ChangeSpecAmtBy(-std::max({}, TotalAccountValue()));
}
else
{
@@ -951,7 +951,7 @@ void AccountValue::TxOptionChange()
case mce_rop:
if(OptChgCanDecrSA)
{
- ChangeSpecAmtBy(-std::max(currency(), CumPmts));
+ ChangeSpecAmtBy(-std::max({}, CumPmts));
}
else
{
@@ -985,7 +985,7 @@ void AccountValue::TxSpecAmtChange()
// > post-1035 exchange calculation of the seven pay will have a death benefit
// > amount to base its calculations on.
#if 1
- ChangeSpecAmtBy(currency());
+ ChangeSpecAmtBy({});
#else // 0
// TODO ?? Changing specamt by zero is absurd. The following
// commented-out alternative seems to do the same thing as
@@ -1377,7 +1377,7 @@ void AccountValue::TxRecognizePaymentFor7702A
,bool a_this_payment_is_unnecessary
)
{
- if(currency() == a_pmt)
+ if(C0 == a_pmt)
{
return;
}
@@ -1417,12 +1417,12 @@ void AccountValue::TxRecognizePaymentFor7702A
//============================================================================
void AccountValue::TxAcceptPayment(currency a_pmt)
{
- if(currency() == a_pmt)
+ if(C0 == a_pmt)
{
return;
}
- if(a_pmt < currency())
+ if(a_pmt < C0)
warning()
<< a_pmt << " a_pmt\n"
<< Year << " Year\n"
@@ -1430,12 +1430,12 @@ void AccountValue::TxAcceptPayment(currency a_pmt)
// << z << " z\n"
<< LMI_FLUSH
;
- LMI_ASSERT(currency() <= a_pmt);
+ LMI_ASSERT(C0 <= a_pmt);
// Internal 1035 exchanges may be exempt from premium tax; they're
// handled elsewhere, so here the exempt amount is always zero.
- currency actual_load = GetPremLoad(a_pmt, currency());
+ currency actual_load = GetPremLoad(a_pmt, {});
currency net_pmt = a_pmt - actual_load;
- LMI_ASSERT(currency() <= net_pmt);
+ LMI_ASSERT(C0 <= net_pmt);
NetPmts[Month] += net_pmt;
// If a payment on an ROP contract is treated as an adjustable event,
@@ -1451,7 +1451,7 @@ void AccountValue::TxAcceptPayment(currency a_pmt)
if(HoneymoonActive)
{
- HoneymoonValue += std::max(currency(), a_pmt);
+ HoneymoonValue += std::max({}, a_pmt);
}
CumPmts += a_pmt;
@@ -1492,7 +1492,7 @@ currency AccountValue::GetPremLoad
{
currency excess_portion;
// All excess.
- if(currency() == UnusedTargetPrem)
+ if(C0 == UnusedTargetPrem)
{
excess_portion = a_pmt;
}
@@ -1500,12 +1500,12 @@ currency AccountValue::GetPremLoad
else if(UnusedTargetPrem < a_pmt)
{
excess_portion = a_pmt - UnusedTargetPrem;
- UnusedTargetPrem = currency();
+ UnusedTargetPrem = {};
}
// All target.
else
{
- excess_portion = currency();
+ excess_portion = {};
UnusedTargetPrem -= a_pmt;
}
currency target_portion = a_pmt - excess_portion;
@@ -1559,10 +1559,10 @@ currency AccountValue::GetRefundableSalesLoad() const
#if 0
// CURRENCY !! Assertions such as these are desirable, but adding
// them now would cause regression artifacts.
- LMI_ASSERT(currency() <= CumulativeSalesLoad);
- LMI_ASSERT(currency() <= YearsSalesLoadRefundRate);
+ LMI_ASSERT(C0 <= CumulativeSalesLoad);
+ LMI_ASSERT(C0 <= YearsSalesLoadRefundRate);
double const z = CumulativeSalesLoad * YearsSalesLoadRefundRate;
- LMI_ASSERT(currency() <= z);
+ LMI_ASSERT(C0 <= z);
return z;
#endif // 0
}
@@ -1578,7 +1578,7 @@ void AccountValue::TxLoanRepay()
}
// Nothing to do if no loan repayment requested.
- if(currency() <= RequestedLoan)
+ if(C0 <= RequestedLoan)
{
return;
}
@@ -1589,8 +1589,8 @@ void AccountValue::TxLoanRepay()
ActualLoan = -std::min(-RequestedLoan, RegLnBal + PrfLnBal);
process_distribution(ActualLoan);
- LMI_ASSERT(currency() == progressively_reduce(AVRegLn , AVPrfLn ,
-ActualLoan));
- LMI_ASSERT(currency() == progressively_reduce(RegLnBal, PrfLnBal,
-ActualLoan));
+ LMI_ASSERT(C0 == progressively_reduce(AVRegLn , AVPrfLn , -ActualLoan));
+ LMI_ASSERT(C0 == progressively_reduce(RegLnBal, PrfLnBal, -ActualLoan));
// This seems wrong. If we're changing something that's invariant among
// bases, why do we change it for each basis?
@@ -1612,7 +1612,7 @@ void AccountValue::TxSetBOMAV()
{
if(!yare_input_.TermRider && !TermIsNotRider)
{
- LMI_ASSERT(currency() == term_specamt(0));
+ LMI_ASSERT(C0 == term_specamt(0));
}
LMI_ASSERT(yare_input_.InforceSpecAmtLoadBase <= SpecAmtLoadLimit);
SpecAmtLoadBase = round_specamt().c
@@ -1691,7 +1691,7 @@ void AccountValue::TxSetDeathBft()
case mce_option2:
{
// Negative AV doesn't decrease death benefit.
- DBIgnoringCorr = ActualSpecAmt + std::max(currency(),
TotalAccountValue());
+ DBIgnoringCorr = ActualSpecAmt + std::max({}, TotalAccountValue());
DB7702A = ActualSpecAmt;
}
break;
@@ -1700,8 +1700,8 @@ void AccountValue::TxSetDeathBft()
// SA + sum of premiums less withdrawals, but not < SA;
// i.e., ignore 'CumPmts' if it is less than zero, as it
// easily can be, e.g., if WDs are not limited to basis.
- DBIgnoringCorr = ActualSpecAmt + std::max(currency(), CumPmts);
- DB7702A = ActualSpecAmt + std::max(currency(), CumPmts);
+ DBIgnoringCorr = ActualSpecAmt + std::max({}, CumPmts);
+ DB7702A = ActualSpecAmt + std::max({}, CumPmts);
}
break;
case mce_mdb:
@@ -1709,18 +1709,18 @@ void AccountValue::TxSetDeathBft()
// Specamt is a floor under DB (and therefore zero here)
// because this option defines the DB as the minimum
// required by the corridor (but not less than zero).
- DBIgnoringCorr = currency();
- DB7702A = currency();
+ DBIgnoringCorr = {};
+ DB7702A = {};
}
break;
}
- LMI_ASSERT(currency() <= DBIgnoringCorr);
+ LMI_ASSERT(C0 <= DBIgnoringCorr);
// Surrender charges are generally ignored here, but any negative
// surrender charge must be subtracted, increasing the account value.
currency cash_value_for_corridor =
TotalAccountValue()
- - std::min(currency(), SurrChg())
+ - std::min({}, SurrChg())
+ GetRefundableSalesLoad()
// + std::max(0.0, ExpRatReserve) // This would be added if it existed.
;
@@ -1732,10 +1732,10 @@ void AccountValue::TxSetDeathBft()
DBReflectingCorr = std::max
(DBIgnoringCorr
- ,round_death_benefit().c(YearsCorridorFactor * std::max(currency(),
cash_value_for_corridor))
+ ,round_death_benefit().c(YearsCorridorFactor * std::max({},
cash_value_for_corridor))
);
DBReflectingCorr = round_death_benefit().c(DBReflectingCorr); // already
rounded?
- LMI_ASSERT(currency() <= DBReflectingCorr);
+ LMI_ASSERT(C0 <= DBReflectingCorr);
// This overrides the value assigned above. There's more than one
// way to interpret 7702A "death benefit"; this is just one.
// TAXATION !! Use DB_Irc7702BftIsSpecAmt
@@ -1746,7 +1746,7 @@ void AccountValue::TxSetDeathBft()
, (
YearsCorridorFactor
* ( Dcv
- - std::min(currency(), SurrChg()).d()
+ - std::min({}, SurrChg()).d()
+ GetRefundableSalesLoad().d()
// + std::max(0.0, ExpRatReserve) // This would be added if
it existed.
)
@@ -1781,7 +1781,7 @@ void AccountValue::TxSetTermAmt()
return;
}
- TermDB = std::max(currency(), TermSpecAmt + DBIgnoringCorr -
DBReflectingCorr);
+ TermDB = std::max({}, TermSpecAmt + DBIgnoringCorr - DBReflectingCorr);
TermDB = round_death_benefit().c(TermDB); // already rounded?
}
@@ -1812,8 +1812,8 @@ void AccountValue::EndTermRider(bool convert)
{
ChangeSpecAmtBy(TermSpecAmt);
}
- TermSpecAmt = currency();
- TermDB = currency();
+ TermSpecAmt = {};
+ TermDB = {};
// Carry the new term spec amt forward into all future years.
for(int j = Year; j < BasicValues::GetLength(); ++j)
{
@@ -1892,7 +1892,7 @@ void AccountValue::TxSetCoiCharge()
void AccountValue::TxSetRiderDed()
{
- AdbCharge = currency();
+ AdbCharge = {};
if(yare_input_.AccidentalDeathBenefit)
{
AdbCharge = round_rider_charges().c
@@ -1900,7 +1900,7 @@ void AccountValue::TxSetRiderDed()
);
}
- SpouseRiderCharge = currency();
+ SpouseRiderCharge = {};
if(yare_input_.SpouseRider)
{
SpouseRiderCharge = round_rider_charges().c
@@ -1908,7 +1908,7 @@ void AccountValue::TxSetRiderDed()
);
}
- ChildRiderCharge = currency();
+ ChildRiderCharge = {};
if(yare_input_.ChildRider)
{
ChildRiderCharge = round_rider_charges().c
@@ -1916,7 +1916,7 @@ void AccountValue::TxSetRiderDed()
);
}
- TermCharge = currency();
+ TermCharge = {};
DcvTermCharge = 0.0;
if(TermRiderActive)
{
@@ -1930,7 +1930,7 @@ void AccountValue::TxSetRiderDed()
DcvTermCharge = YearsDcvCoiRate * TermDB * DBDiscountRate[Year];
}
- WpCharge = currency();
+ WpCharge = {};
DcvWpCharge = 0.0;
if(yare_input_.WaiverOfPremiumBenefit)
{
@@ -1985,7 +1985,7 @@ void AccountValue::TxDoMlyDed()
if(TermRiderActive && TermCanLapse && (AVGenAcct + AVSepAcct - CoiCharge)
< TermCharge)
{
EndTermRider(false);
- TermCharge = currency();
+ TermCharge = {};
}
// 'Simple' riders are the same for AV and DCV.
@@ -2057,7 +2057,7 @@ void AccountValue::TxTestHoneymoonForExpiration()
// And it doesn't make sense for the honeymoon provision to
// keep the contract in force if 'HoneymoonValue' is -10000
// and CSV is -20000.
- if(HoneymoonValue <= currency() || HoneymoonValue < csv_ignoring_loan)
+ if(HoneymoonValue <= C0 || HoneymoonValue < csv_ignoring_loan)
{
HoneymoonActive = false;
// In 'master', this is
@@ -2232,7 +2232,7 @@ void AccountValue::TxCreditInt()
gross_sep_acct_rate = 0.0;
}
- if(currency() < AVSepAcct)
+ if(C0 < AVSepAcct)
{
SepAcctIntCred = InterestCredited(AVSepAcct, YearsSepAcctIntRate);
currency gross = InterestCredited(AVSepAcct, gross_sep_acct_rate);
@@ -2241,10 +2241,10 @@ void AccountValue::TxCreditInt()
}
else
{
- SepAcctIntCred = currency();
+ SepAcctIntCred = {};
}
- if(currency() < AVGenAcct)
+ if(C0 < AVGenAcct)
{
double effective_general_account_interest_factor = YearsGenAcctIntRate;
if
@@ -2265,7 +2265,7 @@ void AccountValue::TxCreditInt()
}
else
{
- GenAcctIntCred = currency();
+ GenAcctIntCred = {};
}
LMI_ASSERT(0.0 <= Dcv);
@@ -2283,7 +2283,7 @@ void AccountValue::TxCreditInt()
}
// Loaned account value must not be negative.
- LMI_ASSERT(currency() <= AVRegLn && currency() <= AVPrfLn);
+ LMI_ASSERT(C0 <= AVRegLn && C0 <= AVPrfLn);
currency z = RegLnIntCred + PrfLnIntCred + SepAcctIntCred + GenAcctIntCred;
YearsTotalNetIntCredited += z;
@@ -2296,11 +2296,11 @@ void AccountValue::TxLoanInt()
{
// Reinitialize to zero before potential early exit, to sweep away
// any leftover values (e.g., after a loan has been paid off).
- RegLnIntCred = currency();
- PrfLnIntCred = currency();
+ RegLnIntCred = {};
+ PrfLnIntCred = {};
// Nothing more to do if there's no loan outstanding.
- if(currency() == RegLnBal && currency() == PrfLnBal)
+ if(C0 == RegLnBal && C0 == PrfLnBal)
{
return;
}
@@ -2407,20 +2407,20 @@ void AccountValue::TxTakeWD()
return;
}
- GrossWD = currency();
+ GrossWD = {};
RequestedWD = Outlay_->withdrawals()[Year];
- if(Debugging || currency() != RequestedWD)
+ if(Debugging || C0 != RequestedWD)
{
SetMaxWD();
}
- NetWD = currency();
+ NetWD = {};
// Nothing more to do if no withdrawal requested.
- if(currency() == RequestedWD)
+ if(C0 == RequestedWD)
{
- withdrawal_ullage_[Year] = currency();
+ withdrawal_ullage_[Year] = {};
// This seems wrong. If we're changing something that's invariant among
// bases, why do we change it for each basis?
// TODO ?? Shouldn't this be moved to FinalizeMonth()?
@@ -2434,7 +2434,7 @@ void AccountValue::TxTakeWD()
if(Solving)
{
- withdrawal_ullage_[Year] = std::max(currency(), RequestedWD - MaxWD);
+ withdrawal_ullage_[Year] = std::max({}, RequestedWD - MaxWD);
}
if(Solving || mce_run_gen_curr_sep_full == RunBasis_)
@@ -2458,8 +2458,8 @@ void AccountValue::TxTakeWD()
// Impose minimum amount on withdrawals.
if(RequestedWD < MinWD)
{
- withdrawal_ullage_[Year] = currency();
- NetWD = currency();
+ withdrawal_ullage_[Year] = {};
+ NetWD = {};
}
// TODO ?? If WD zero, skip some steps? Cannot simply return in this case
// because user may prefer to shift to loans.
@@ -2480,10 +2480,10 @@ void AccountValue::TxTakeWD()
// Even after the entire basis has been withdrawn, we still
// take withdrawals if payments since have increased the basis.
// TODO ?? Should RequestedWD be constrained by MaxWD and MinWD here?
- if(currency() == TaxBasis || std::min(TaxBasis, RequestedWD) < MinWD)
// All loan
+ if(C0 == TaxBasis || std::min(TaxBasis, RequestedWD) < MinWD) // All
loan
{
- withdrawal_ullage_[Year] = currency();
- NetWD = currency();
+ withdrawal_ullage_[Year] = {};
+ NetWD = {};
}
else if(NetWD < TaxBasis) // All WD
{
@@ -2498,7 +2498,7 @@ void AccountValue::TxTakeWD()
RequestedLoan += RequestedWD - NetWD;
}
- if(NetWD <= currency())
+ if(NetWD <= C0)
{
// TODO ?? What should this be?
// withdrawal_ullage_[Year] = ?
@@ -2552,8 +2552,8 @@ void AccountValue::TxTakeWD()
currency av = TotalAccountValue();
currency csv = av - SurrChg_[Year];
- LMI_ASSERT(currency() <= SurrChg_[Year]);
- if(csv <= currency())
+ LMI_ASSERT(C0 <= SurrChg_[Year]);
+ if(csv <= C0)
{
// TODO ?? What should this be?
// withdrawal_ullage_[Year] = ?
@@ -2690,7 +2690,7 @@ void AccountValue::SetMaxLoan()
(AVGenAcct + AVSepAcct).d() * MaxLoanAVMult
+ (AVRegLn + AVPrfLn).d()
- anticipated_deduction(MaxLoanDed_).d()
- - std::max(currency(), SurrChg()).d()
+ - std::max({}, SurrChg()).d()
;
// Illustrations generally permit loans only on anniversary.
@@ -2756,15 +2756,15 @@ void AccountValue::TxTakeLoan()
// Even if no loan is requested, the maximum loan is still shown
// in a monthly trace.
- if(Debugging || currency() <= RequestedLoan)
+ if(Debugging || C0 <= RequestedLoan)
{
SetMaxLoan();
}
// Nothing more to do if no loan requested.
- if(RequestedLoan <= currency())
+ if(RequestedLoan <= C0)
{
- loan_ullage_[Year] = currency();
+ loan_ullage_[Year] = {};
return;
}
@@ -2776,12 +2776,12 @@ void AccountValue::TxTakeLoan()
if(Solving)
{
ActualLoan = RequestedLoan;
- loan_ullage_[Year] = std::max(currency(), RequestedLoan -
max_loan_increment);
+ loan_ullage_[Year] = std::max({}, RequestedLoan - max_loan_increment);
}
else
{
ActualLoan = std::min(max_loan_increment, RequestedLoan);
- ActualLoan = std::max(ActualLoan, currency());
+ ActualLoan = std::max(ActualLoan, {});
// TODO ?? Shouldn't this happen in FinalizeMonth()?
InvariantValues().NewCashLoan[Year] = ActualLoan.d();
}
@@ -2861,7 +2861,7 @@ void AccountValue::TxTestLapse()
;
if(!LapseIgnoresSurrChg)
{
- lapse_test_csv -= std::max(currency(), SurrChg());
+ lapse_test_csv -= std::max({}, SurrChg());
}
lapse_test_csv = std::max(lapse_test_csv, HoneymoonValue);
@@ -2901,11 +2901,11 @@ void AccountValue::TxTestLapse()
// Otherwise if CSV is negative or if overloaned, then lapse the policy.
else if
(
- (!NoLapseActive && lapse_test_csv < currency())
+ (!NoLapseActive && lapse_test_csv < C0)
// Lapse if overloaned regardless of guar DB.
// CSV includes a positive loan (that can offset a negative AV);
// however, we still need to test for NoLapseActive.
- || (!NoLapseActive && (AVGenAcct + AVSepAcct) < currency())
+ || (!NoLapseActive && (AVGenAcct + AVSepAcct) < C0)
// Test for nonnegative unloaned account value.
// We are aware that some companies test against loan balance:
// TODO ?? Would the explicit test
@@ -2933,14 +2933,14 @@ void AccountValue::TxTestLapse()
}
else
{
- if(NoLapseActive && lapse_test_csv < currency())
+ if(NoLapseActive && lapse_test_csv < C0)
{
- AVGenAcct = currency();
- AVSepAcct = currency();
+ AVGenAcct = {};
+ AVSepAcct = {};
// TODO ?? Can't this be done elsewhere?
VariantValues().CSVNet[Year] = 0.0;
}
- else if(!HoneymoonActive && !Solving && lapse_test_csv < currency())
+ else if(!HoneymoonActive && !Solving && lapse_test_csv < C0)
{
alarum()
<< "Unloaned value not positive,"
diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index 30c454d..93f7336 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -223,7 +223,7 @@ currency AccountValue::SolveTest(currency a_CandidateValue)
- VariantValues().AcctVal [SolveTargetDuration_ - 1]
);
}
- if(worst_negative < currency())
+ if(worst_negative < C0)
{
value = std::min(value, worst_negative);
}
@@ -289,7 +289,7 @@ currency AccountValue::SolveGuarPremium()
// Store original er premiums for later restoration.
std::vector<currency> stored = Outlay_->er_modal_premiums();
// Zero out er premiums and solve for ee premiums only.
- Outlay_->set_er_modal_premiums(currency(), 0, BasicValues::GetLength());
+ Outlay_->set_er_modal_premiums({}, 0, BasicValues::GetLength());
bool temp_solving = Solving;
Solving = true;
@@ -301,7 +301,7 @@ currency AccountValue::SolveGuarPremium()
,0
,BasicValues::GetLength()
,mce_solve_for_endt
- ,currency()
+ ,{}
,BasicValues::GetLength()
,mce_gen_guar
,mce_sep_full
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 8bb7f42..8fae821 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -240,7 +240,7 @@ void BasicValues::Init()
// by GPTServerInit(); the value assigned here is overridden by a
// downstream call to Irc7702::Initialize7702(). TAXATION !! So
// eliminate the member when it becomes unnecessary.
- InitialTargetPremium = currency();
+ InitialTargetPremium = {};
SetMaxSurvivalDur();
set_partial_mortality();
@@ -637,7 +637,7 @@ void BasicValues::SetPermanentInvariants()
database().query_into(DB_TgtPremFixedAtIssue , TgtPremFixedAtIssue);
TgtPremMonthlyPolFee =
currency(database().query<int>(DB_TgtPremMonthlyPolFee));
// Assertion: see comments on GetModalPremTgtFromTable().
- LMI_ASSERT(currency() == TgtPremMonthlyPolFee || oe_modal_table ==
TgtPremType);
+ LMI_ASSERT(C0 == TgtPremMonthlyPolFee || oe_modal_table == TgtPremType);
database().query_into(DB_CurrCoiTable0Limit , CurrCoiTable0Limit);
database().query_into(DB_CurrCoiTable1Limit , CurrCoiTable1Limit);
// NO!
diff --git a/solve.cpp b/solve.cpp
index 31ecefc..3b98af0 100644
--- a/solve.cpp
+++ b/solve.cpp
@@ -94,7 +94,7 @@ currency SolveTest()
}
currency z = currency(ConstThat->VariantValues().CSVNet[ThatSolveTgtYear -
1]);
- if(Negative < currency())
+ if(Negative < C0)
z = std::min(z, Negative);
// IHS !! If SolveTgtYr within no-lapse period...see lmi.