[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] valyuta/002 b07371e 17/21: Avoid implicit conversion
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] valyuta/002 b07371e 17/21: Avoid implicit conversions yet more avidly |
Date: |
Fri, 18 Sep 2020 21:53:49 -0400 (EDT) |
branch: valyuta/002
commit b07371ec22ece507857d75a66a518262358f2cf9
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Avoid implicit conversions yet more avidly
Explicit rounding is now specified, using two styles that potentially
differ, each one being appropriate to its context. The generic style
used in the currency class is clearly less appropriate.
---
currency.hpp | 3 ---
ihs_avmly.cpp | 7 ++++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/currency.hpp b/currency.hpp
index 9c95310..4aa8e56 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -97,9 +97,6 @@ class currency
currency& operator-=(currency z) {m_ -= z.m_; return *this;}
// There can be no operator*() that returns a result in dollars^2.
- currency& operator+=(double z) {m_ += from_double(z); return *this;}
- currency& operator-=(double z) {m_ -= from_double(z); return *this;}
-
// Mixed-mode arithmetic is generally to be avoided, but it is
// safe to multiply currency by an integer such as twelve:
// $1 monthly really does equal $12 annually. No operator/(int)
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 2e606d4..41e7a1e 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -614,10 +614,11 @@ void AccountValue::TxExch1035()
}
CumPmts += GrossPmts[Month];
- TaxBasis +=
+ TaxBasis += round_minutiae().c
+ (
yare_input_.External1035ExchangeTaxBasis
+ yare_input_.Internal1035ExchangeTaxBasis
- ;
+ );
if(mce_run_gen_curr_sep_full == RunBasis_)
{
@@ -1519,7 +1520,7 @@ currency AccountValue::GetPremLoad
+ excess_portion * YearsSalesLoadExc
;
LMI_ASSERT(0.0 <= sales_load_);
- CumulativeSalesLoad += sales_load_;
+ CumulativeSalesLoad += round_net_premium().c(sales_load_);
premium_tax_load_ = PremiumTax_->calculate_load
((a_pmt - a_portion_exempt_from_premium_tax).d()
- [lmi-commits] [lmi] valyuta/002 d1c1af3 01/21: Revert "Trivially avoid spurious regression errors", (continued)
- [lmi-commits] [lmi] valyuta/002 d1c1af3 01/21: Revert "Trivially avoid spurious regression errors", Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 693dac0 02/21: Revert "Make it even faster", Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 24abb3f 03/21: Revert "Make it more faster", Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 95f34c4 06/21: Get rid of unneeded scalar doubleize(), Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 9dc1602 10/21: Remove double relops, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 b803441 12/21: Improve documentation, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 06046b6 05/21: Revert "Make it float", Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 215244a 13/21: Avoid implicit mixed-mode calculations more avidly, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 63419d4 14/21: Improve documentation, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 d8e2470 15/21: Refactor for clarity, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 b07371e 17/21: Avoid implicit conversions yet more avidly,
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/002 331e748 18/21: Unbreak a unit test, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 02d03f2 08/21: Discard more commented-out code, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 3266cfe 11/21: Establish a separate test/ directory for this branch, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 0e9baa5 16/21: Use currency where currency is wanted, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 97e9057 21/21: Fix a unit test, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 8785c00 19/21: Implement negation operator, Greg Chicares, 2020/09/18
- [lmi-commits] [lmi] valyuta/002 97eb31d 20/21: Use negation operator, Greg Chicares, 2020/09/18