[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] valyuta/002 9da6616 55/65: Round explicitly in a few
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] valyuta/002 9da6616 55/65: Round explicitly in a few more cases |
Date: |
Wed, 16 Sep 2020 16:55:21 -0400 (EDT) |
branch: valyuta/002
commit 9da6616c1390e44e05c1203b21cec5b272debc09
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Round explicitly in a few more cases
Perhaps a double should never be converted to currency without calling
an explicit rounding function, as there are quite a few to choose from.
---
ihs_avmly.cpp | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 6e51782..c8e27bc 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -142,7 +142,7 @@ void AccountValue::DoMonthDR()
// exchanges, but now seems unnecessary because this
// assertion never fires:
// LMI_ASSERT(kludge_account_value == Dcv);
- kludge_account_value = currency(Dcv);
+ kludge_account_value = round_minutiae().c(Dcv);
}
kludge_account_value = std::max
(HoneymoonValue
@@ -169,8 +169,8 @@ void AccountValue::DoMonthDR()
// Saved for monthly detail report only. TAXATION !! Then are
// these still needed...perhaps in order to report their values
// prior to accepting any payment?
- NetMaxNecessaryPremium = currency(Irc7702A_->DebugGetNetMaxNecPm ());
- GrossMaxNecessaryPremium = currency(Irc7702A_->DebugGetGrossMaxNecPm());
+ NetMaxNecessaryPremium =
round_minutiae().c(Irc7702A_->DebugGetNetMaxNecPm ());
+ GrossMaxNecessaryPremium =
round_minutiae().c(Irc7702A_->DebugGetGrossMaxNecPm());
// Determine list-bill premiums only after transactions that
// might change specamt have been processed.
@@ -214,8 +214,8 @@ void AccountValue::DoMonthDR()
);
// NetMaxNecessaryPremium
// GrossMaxNecessaryPremium
- NecessaryPremium = currency(necessary_premium );
- UnnecessaryPremium = currency(unnecessary_premium);
+ NecessaryPremium = round_minutiae().c(necessary_premium );
+ UnnecessaryPremium = round_minutiae().c(unnecessary_premium);
if(necessary_premium < 0.0 || unnecessary_premium < 0.0)
warning()
// << GrossPmts[Month] << " GrossPmts[Month]\n"
@@ -558,7 +558,7 @@ void AccountValue::TxExch1035()
// Maybe this should return the modified value instead of altering
the argument.
double z = GrossPmts[Month].d();
Irc7702_->ProcessGptPmt(Year, z);
- GrossPmts[Month] = currency(z);
+ GrossPmts[Month] = round_gross_premium().c(z);
}
// Limit external 1035 first, then internal, as necessary to avoid
// exceeding the guideline limit. This is what the customer would
@@ -1142,7 +1142,7 @@ void AccountValue::TxTestGPT()
);
}
- GptForceout = currency(Irc7702_->Forceout());
+ GptForceout = round_minutiae().c(Irc7702_->Forceout());
// TODO ?? TAXATION !! On other bases, nothing is forced out, and payments
aren't limited.
process_distribution(GptForceout);
YearsTotalGptForceout += GptForceout;
@@ -1234,7 +1234,7 @@ void AccountValue::TxAscertainDesiredPayment()
{
double z = eepmt.d();
Irc7702_->ProcessGptPmt(Year, z);
- eepmt = currency(z);
+ eepmt = round_gross_premium().c(z);
}
EeGrossPmts[Month] += eepmt;
GrossPmts [Month] += eepmt;
@@ -1249,7 +1249,7 @@ void AccountValue::TxAscertainDesiredPayment()
{
double z = erpmt.d();
Irc7702_->ProcessGptPmt(Year, z);
- erpmt = currency(z);
+ erpmt = round_gross_premium().c(z);
}
ErGrossPmts[Month] += erpmt;
GrossPmts [Month] += erpmt;
@@ -1276,7 +1276,7 @@ void AccountValue::TxAscertainDesiredPayment()
{
double z = Dumpin.d();
Irc7702_->ProcessGptPmt(Year, z);
- Dumpin = currency(z);
+ Dumpin = round_gross_premium().c(z);
}
EeGrossPmts[Month] += Dumpin;
GrossPmts [Month] += Dumpin;
@@ -1387,7 +1387,7 @@ void AccountValue::TxRecognizePaymentFor7702A
currency kludge_account_value = std::max(TotalAccountValue(),
HoneymoonValue);
if(0 == Year && 0 == Month)
{
- kludge_account_value = currency(Dcv);
+ kludge_account_value = round_minutiae().c(Dcv);
}
kludge_account_value = std::max
(HoneymoonValue
- [lmi-commits] [lmi] valyuta/002 f7f87b2 42/65: unit test: overflow, (continued)
- [lmi-commits] [lmi] valyuta/002 f7f87b2 42/65: unit test: overflow, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 9ea1df7 54/65: further improve preceding commit, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 ba43414 61/65: Record 64-bit timings, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 fb82290 63/65: Use maximal 64-bit rather than 32-bit integer value, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 8fd00bb 34/65: rework operator*(), Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 bf1943b 03/65: reformat, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 7481c2b 09/65: discard--throwaway assertions, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 998fdf5 35/65: operator/(), Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 c105c78 29/65: Currency: implement binary operator-, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 9cf4517 46/65: c(), Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 9da6616 55/65: Round explicitly in a few more cases,
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/002 0e8c429 12/65: rounding, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 794727e 22/65: Round when converting from double to currency, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 d137177 02/65: Currency, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 ba6a8d1 31/65: implement currency comparisons as free functions, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 28a5e54 39/65: make data_type public, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 e9f5447 30/65: round currency to currency? huh?, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 90773f3 47/65: currency() rather than currency(0.0), Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 5f00c5a 43/65: Add a commented-out idea, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 2dabfcf 62/65: Try to make something a little less arcane, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 9433c8e 65/65: Discuss timing, and philosophical and political questions, Greg Chicares, 2020/09/16