lmi-commits
[Top][All Lists]
Advanced

[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()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]