lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] valyuta/002 998fdf5 35/65: operator/()


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/002 998fdf5 35/65: operator/()
Date: Wed, 16 Sep 2020 16:55:17 -0400 (EDT)

branch: valyuta/002
commit 998fdf509666aff1b9937c2c877fc03c4cf4e124
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    operator/()
    
    avoid currency/currency, for now at least
---
 currency.hpp  | 2 ++
 ihs_avmly.cpp | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/currency.hpp b/currency.hpp
index 66db12e..30cb132 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -198,6 +198,8 @@ inline currency    operator*(currency lhs, int    rhs) 
{return lhs *= rhs;}
 inline currency    operator*(int    lhs, currency rhs) {return rhs *= lhs;}
 //inline currency operator*(currency lhs, int rhs) {return lhs *= rhs;}
 //inline currency operator*(int lhs, currency rhs) {return rhs *= lhs;}
+inline double operator/(currency lhs, double rhs) {return lhs.d() /  rhs;}
+inline double operator/(double lhs, currency rhs) {return lhs /  rhs.d();}
 
 inline std::ostream& operator<<(std::ostream& os, currency const& c)
 {
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 78dfdb3..2163af3 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -301,7 +301,7 @@ void AccountValue::process_payment(currency payment)
     double er_proportion = 0.0;
     if(0.0 != gross_non_1035_pmts)
         {
-        er_proportion = ErGrossPmts[Month] / gross_non_1035_pmts;
+        er_proportion = ErGrossPmts[Month] / gross_non_1035_pmts.d();
         }
 
     // This is a net premium that's multiplied by a gross-premium
@@ -736,7 +736,7 @@ void AccountValue::ChangeSpecAmtBy(currency delta)
                 break;
             case mce_adjust_both:
                 {
-                term_proportion = TermSpecAmt / old_total_specamt;
+                term_proportion = TermSpecAmt / old_total_specamt.d();
                 }
                 break;
             case mce_adjust_base:
@@ -2570,7 +2570,7 @@ void AccountValue::TxTakeWD()
     // charge. This would become more complicated if we maintained
     // distinct surrender-charge layers.
 
-    double surrchg_proportion = SurrChg_[Year] / csv;
+    double surrchg_proportion = SurrChg_[Year] / csv.d();
     currency non_free_wd = GrossWD;
     if(0.0 != FreeWDProportion[Year])
         {



reply via email to

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