[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 82d6007 4/4: Round refundable sales load
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 82d6007 4/4: Round refundable sales load |
Date: |
Mon, 25 Jan 2021 22:13:34 -0500 (EST) |
branch: master
commit 82d6007ee06153fa5cb2ed53efe131b13438a813
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Round refundable sales load
This must be rounded, for the simple reason that fractional cents cannot
be refunded. The largest regression observed is
+ 17101789.4033427275717
- 17101789.7225377298892
in first-year cash surrender value on a 185-life case. That may seem no
better on the face of it, but that's probably because it's a composite
that may reflect nonintegral probabilities of survival. Choosing one
particular cell shows the real improvement:
+ 20261.8300000000053842
- 20261.8249150000046939
which is a reduction of nine orders of magnitude in the error: the best
that can be achieved without using the currency class, which will give a
value such as 2026183 cents exactly.
---
ihs_avmly.cpp | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index 05c117c..318eaba 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -1429,9 +1429,7 @@ currency AccountValue::GetPremLoad
+ excess_portion * YearsSalesLoadExc
;
LMI_ASSERT(0.0 <= sales_load_);
- // CURRENCY !! ROUNDING This needs to be rounded.
-// CumulativeSalesLoad += round_net_premium().c(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
@@ -1465,8 +1463,7 @@ currency AccountValue::GetPremLoad
//============================================================================
currency AccountValue::GetRefundableSalesLoad() const
{
- // CURRENCY !! ROUNDING This needs to be rounded.
- return CumulativeSalesLoad * YearsSalesLoadRefundRate;
+ return round_net_premium().c(CumulativeSalesLoad *
YearsSalesLoadRefundRate);
#if 0
// CURRENCY !! Assertions such as these are desirable, but adding
// them now would cause regression artifacts.