[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])
{
- [lmi-commits] [lmi] valyuta/002 6381b2f 44/65: Throw on overflow, (continued)
- [lmi-commits] [lmi] valyuta/002 6381b2f 44/65: Throw on overflow, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 e0c5136 45/65: improve documentation, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 7bac50c 50/65: default-initialize currency, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 f7f87b2 42/65: unit test: overflow, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 9ea1df7 54/65: further improve preceding commit, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 ba43414 61/65: Record 64-bit timings, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 fb82290 63/65: Use maximal 64-bit rather than 32-bit integer value, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 8fd00bb 34/65: rework operator*(), Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 bf1943b 03/65: reformat, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 7481c2b 09/65: discard--throwaway assertions, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 998fdf5 35/65: operator/(),
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/002 c105c78 29/65: Currency: implement binary operator-, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 9cf4517 46/65: c(), Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 9da6616 55/65: Round explicitly in a few more cases, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 0e8c429 12/65: rounding, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 794727e 22/65: Round when converting from double to currency, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 d137177 02/65: Currency, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 ba6a8d1 31/65: implement currency comparisons as free functions, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 28a5e54 39/65: make data_type public, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 e9f5447 30/65: round currency to currency? huh?, Greg Chicares, 2020/09/16
- [lmi-commits] [lmi] valyuta/002 90773f3 47/65: currency() rather than currency(0.0), Greg Chicares, 2020/09/16