lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/005 e124445 4/5: Don't use currency when it


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/005 e124445 4/5: Don't use currency when it must always be converted to double
Date: Thu, 28 Jan 2021 17:53:34 -0500 (EST)

branch: valyuta/005
commit e12444540239eadf41d2f5712ff32447469fb3c7
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Don't use currency when it must always be converted to double
---
 gpt_specamt.cpp  | 14 +++++++-------
 gpt_specamt.hpp  |  6 +++---
 ihs_basicval.cpp |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gpt_specamt.cpp b/gpt_specamt.cpp
index a9116bd..a09d012 100644
--- a/gpt_specamt.cpp
+++ b/gpt_specamt.cpp
@@ -31,7 +31,7 @@
 currency gpt_specamt::CalculateGLPSpecAmt
     (BasicValues const& a_Values
     ,int                a_Duration
-    ,currency           a_Premium
+    ,double             a_Premium
     ,mcenum_dbopt_7702  a_DBOpt
     )
 {
@@ -49,7 +49,7 @@ currency gpt_specamt::CalculateGLPSpecAmt
 currency gpt_specamt::CalculateGSPSpecAmt
     (BasicValues const& a_Values
     ,int                a_Duration
-    ,currency           a_Premium
+    ,double             a_Premium
     )
 {
     Irc7702 const& z(safely_dereference_as<Irc7702>(a_Values.Irc7702_.get()));
@@ -70,7 +70,7 @@ class FindSpecAmt
     Irc7702     const& Irc7702_;
     EIOBasis    const  EIOBasis_;
     int         const  Duration;
-    double      const  Premium; // CURRENCY !! not currency?
+    double      const  Premium;
     double      const  NetPmtFactorTgt;
     double      const  NetPmtFactorExc;
     currency           SpecAmt;
@@ -81,7 +81,7 @@ class FindSpecAmt
         ,Irc7702 const&     a_IRC7702
         ,EIOBasis           a_EIOBasis
         ,int                a_Duration
-        ,double             a_Premium // CURRENCY !! not currency?
+        ,double             a_Premium
         ,double             a_NetPmtFactorTgt
         ,double             a_NetPmtFactorExc
         )
@@ -135,12 +135,12 @@ currency gpt_specamt::CalculateSpecAmt
     (BasicValues const& a_Values
     ,EIOBasis           a_EIOBasis
     ,int                a_Duration
-    ,currency           a_Premium
+    ,double             a_Premium
     ,double             a_NetPmtFactorTgt
     ,double             a_NetPmtFactorExc
     )
 {
-    LMI_ASSERT(C0  != a_Premium);
+    LMI_ASSERT(0.0 != a_Premium);
     LMI_ASSERT(0.0 != a_NetPmtFactorTgt);
     LMI_ASSERT(0.0 != a_NetPmtFactorExc);
 
@@ -151,7 +151,7 @@ currency gpt_specamt::CalculateSpecAmt
         ,z
         ,a_EIOBasis
         ,a_Duration
-        ,dblize(a_Premium)
+        ,a_Premium
         ,a_NetPmtFactorTgt
         ,a_NetPmtFactorExc
         );
diff --git a/gpt_specamt.hpp b/gpt_specamt.hpp
index d94c7ca..9a0d238 100644
--- a/gpt_specamt.hpp
+++ b/gpt_specamt.hpp
@@ -57,13 +57,13 @@ class gpt_specamt
     static currency CalculateGLPSpecAmt
         (BasicValues const& a_Values
         ,int                a_Duration
-        ,currency           a_Premium
+        ,double             a_Premium
         ,mcenum_dbopt_7702  a_DBOpt
         );
     static currency CalculateGSPSpecAmt
         (BasicValues const& a_Values
         ,int                a_Duration
-        ,currency           a_Premium
+        ,double             a_Premium
         );
 
   private:
@@ -71,7 +71,7 @@ class gpt_specamt
         (BasicValues const& a_Values
         ,Irc7702::EIOBasis  a_EIOBasis
         ,int                a_Duration
-        ,currency           a_Premium
+        ,double             a_Premium
         ,double             a_NetPmtFactorTgt
         ,double             a_NetPmtFactorExc
         );
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 812fb95..ef8b00a 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -1458,13 +1458,13 @@ currency BasicValues::GetModalSpecAmtMinNonMec(currency 
annualized_pmt) const
 currency BasicValues::GetModalSpecAmtGLP(currency annualized_pmt) const
 {
     mcenum_dbopt_7702 const z = effective_dbopt_7702(DeathBfts_->dbopt()[0], 
Effective7702DboRop);
-    return gpt_specamt::CalculateGLPSpecAmt(*this, 0, annualized_pmt, z);
+    return gpt_specamt::CalculateGLPSpecAmt(*this, 0, dblize(annualized_pmt), 
z);
 }
 
 //============================================================================
 currency BasicValues::GetModalSpecAmtGSP(currency annualized_pmt) const
 {
-    return gpt_specamt::CalculateGSPSpecAmt(*this, 0, annualized_pmt);
+    return gpt_specamt::CalculateGSPSpecAmt(*this, 0, dblize(annualized_pmt));
 }
 
 /// Calculate specified amount using a corridor ratio.



reply via email to

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