[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9490b4c 2/8: Avoid using floating-point const
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9490b4c 2/8: Avoid using floating-point constants for boolean values |
Date: |
Wed, 7 Nov 2018 17:11:10 -0500 (EST) |
branch: master
commit 9490b4c04e486c316f43fac9e8db49ee70225a22
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Avoid using floating-point constants for boolean values
---
dbdict.cpp | 24 ++++++++++++------------
interest_rates.cpp | 4 ++--
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dbdict.cpp b/dbdict.cpp
index 0e5750a..da3a503 100644
--- a/dbdict.cpp
+++ b/dbdict.cpp
@@ -951,7 +951,7 @@ void DBDictionary::write_database_files()
z.Add(database_entity(DB_GenAcctIntBonus , 0.0));
// Allow experience rating.
- z.Add(database_entity(DB_AllowExpRating , 1.0));
+ z.Add(database_entity(DB_AllowExpRating , true));
z.Add(database_entity(DB_ExpRatIbnrMult , 6.0));
z.Add(database_entity(DB_ExpRatAmortPeriod , 4.0));
@@ -1007,7 +1007,7 @@ void DBDictionary::InitAntediluvian()
Add(database_entity(DB_GuarPrefLoanSpread, 0.0));
Add(database_entity(DB_CurrPrefLoanSpread, 0.0));
- Add(database_entity(DB_AllowPreferredClass, 1.0));
+ Add(database_entity(DB_AllowPreferredClass, true));
// premium loads
@@ -1047,15 +1047,15 @@ void DBDictionary::InitAntediluvian()
Add(database_entity(DB_AgeLastOrNearest,
oe_age_nearest_birthday_ties_older));
Add(database_entity(DB_MinSpecAmt, 10000.0));
- Add(database_entity(DB_AllowGenAcct, 1.0));
+ Add(database_entity(DB_AllowGenAcct, true));
Add(database_entity(DB_MaxGenAcctRate, 0.12));
Add(database_entity(DB_MaxSepAcctRate, 0.12));
- Add(database_entity(DB_AllowLoan, 1.0));
- Add(database_entity(DB_AllowWd, 1.0));
- Add(database_entity(DB_AllowFlatExtras, 1.0));
- Add(database_entity(DB_AllowChangeToDbo2, 1.0));
- Add(database_entity(DB_AllowDbo3, 1.0));
+ Add(database_entity(DB_AllowLoan, true));
+ Add(database_entity(DB_AllowWd, true));
+ Add(database_entity(DB_AllowFlatExtras, true));
+ Add(database_entity(DB_AllowChangeToDbo2, true));
+ Add(database_entity(DB_AllowDbo3, true));
Add(database_entity(DB_LedgerType, mce_ill_reg));
@@ -1066,10 +1066,10 @@ void DBDictionary::InitAntediluvian()
Add(database_entity(DB_Has1035ExchCharge, 0.0));
Add(database_entity(DB_SmokeOrTobacco, 0.0));
Add(database_entity(DB_DacTaxFundCharge, 0.0));
- Add(database_entity(DB_AllowWp, 0.0));
- Add(database_entity(DB_AllowAdb, 0.0));
- Add(database_entity(DB_AllowSpouseRider, 0.0));
- Add(database_entity(DB_AllowChildRider, 0.0));
+ Add(database_entity(DB_AllowWp, false));
+ Add(database_entity(DB_AllowAdb, false));
+ Add(database_entity(DB_AllowSpouseRider, false));
+ Add(database_entity(DB_AllowChildRider, false));
Add(database_entity(DB_ExpRatAmortPeriod, 4.0));
}
diff --git a/interest_rates.cpp b/interest_rates.cpp
index 0f5f3e7..f91a6d4 100644
--- a/interest_rates.cpp
+++ b/interest_rates.cpp
@@ -256,7 +256,7 @@ InterestRates::InterestRates(BasicValues const& v)
,Zero_ (Length_)
,NeedMidpointRates_ {v.IsSubjectToIllustrationReg()}
,GenAcctRateType_ {v.yare_input_.GeneralAccountRateType}
- ,NeedSepAcctRates_ {0.0 != v.database().query<bool>(DB_AllowSepAcct)}
+ ,NeedSepAcctRates_ {v.database().query<bool>(DB_AllowSepAcct)}
,SepAcctRateType_ {v.yare_input_.SeparateAccountRateType}
,SepAcctSpreadMethod_{v.database().query<mcenum_spread_method>(DB_SepAcctSpreadMethod)}
,AmortLoad_ {Zero_}
@@ -264,7 +264,7 @@ InterestRates::InterestRates(BasicValues const& v)
// ,NeedLoanRates_ {need_loan_rates(v.yare_input_)}
,NeedLoanRates_ {true} // DEPRECATED
,LoanRateType_ {v.yare_input_.LoanRateType}
- ,NeedPrefLoanRates_ {0.0 != v.database().query<bool>(DB_AllowPrefLoan)}
+ ,NeedPrefLoanRates_ {v.database().query<bool>(DB_AllowPrefLoan)}
,NeedHoneymoonRates_ {v.yare_input_.HoneymoonEndorsement}
,SpreadFor7702_ {v.SpreadFor7702()}
{
- [lmi-commits] [lmi] master updated (259f97c -> 6c72fcf), Greg Chicares, 2018/11/07
- [lmi-commits] [lmi] master 284339d 1/8: Document boolean database entities more uniformly, Greg Chicares, 2018/11/07
- [lmi-commits] [lmi] master e4a6ba2 6/8: Use query<bool> with database entities that are inherently boolean, Greg Chicares, 2018/11/07
- [lmi-commits] [lmi] master 39f76e4 4/8: Make a deliberate mistake more obvious in a unit test, Greg Chicares, 2018/11/07
- [lmi-commits] [lmi] master f066478 7/8: Use query<T> with database entities that are inherently enumerative, Greg Chicares, 2018/11/07
- [lmi-commits] [lmi] master 6c72fcf 8/8: Use query<double> with database entities that are inherently floating, Greg Chicares, 2018/11/07
- [lmi-commits] [lmi] master 5e009d6 3/8: Adjust whitespace to improve vertical alignment, Greg Chicares, 2018/11/07
- [lmi-commits] [lmi] master 28105c5 5/8: Use query<int> with database entities that are inherently int, Greg Chicares, 2018/11/07
- [lmi-commits] [lmi] master 9490b4c 2/8: Avoid using floating-point constants for boolean values,
Greg Chicares <=