[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 0b4b7ec 1/8: Don't use currency for amounts a
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 0b4b7ec 1/8: Don't use currency for amounts always converted to double |
Date: |
Tue, 26 Jan 2021 08:12:30 -0500 (EST) |
branch: master
commit 0b4b7eca23b39fd47ebf5b8690aa694bc9958170
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Don't use currency for amounts always converted to double
Although premium ought to be currency in general, GPT calculations are
(intentionally) written in terms of type 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 9636791..1570411 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -1456,13 +1456,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.
- [lmi-commits] [lmi] master updated (15ef269 -> 7066049), Greg Chicares, 2021/01/26
- [lmi-commits] [lmi] master 557ac6e 3/8: Assert rather than assign, Greg Chicares, 2021/01/26
- [lmi-commits] [lmi] master 026214c 4/8: Solve for currency rather than double, Greg Chicares, 2021/01/26
- [lmi-commits] [lmi] master 62b80c4 7/8: Initialize honeymoon value as currency, not double, Greg Chicares, 2021/01/26
- [lmi-commits] [lmi] master 0b4b7ec 1/8: Don't use currency for amounts always converted to double,
Greg Chicares <=
- [lmi-commits] [lmi] master 01886b2 5/8: Round CSV "boost", Greg Chicares, 2021/01/26
- [lmi-commits] [lmi] master e507882 6/8: Remove a useless assertion, Greg Chicares, 2021/01/26
- [lmi-commits] [lmi] master 7066049 8/8: Record speed measurements, Greg Chicares, 2021/01/26
- [lmi-commits] [lmi] master e7ab330 2/8: Store currency as such, Greg Chicares, 2021/01/26