lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 4b8bf312 1/9: Expunge workarounds for nonexis


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 4b8bf312 1/9: Expunge workarounds for nonexistent problems
Date: Fri, 6 May 2022 19:37:34 -0400 (EDT)

branch: master
commit 4b8bf3126590a8e66cc634d631a4a34eeebc28b8
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Expunge workarounds for nonexistent problems
    
    See commit f97235aed48a52 for a real-world example where multiplying
    4.9000000000000003552713679 by $100000 and rounding up yielded 490001
    instead of the desired 490000. Such cases often arise in practice, and
    are the motivation for multiplying by one plus (long double) epsilon
    before rounding [although that workaround was not used in that case].
    
    Removed that workaround in two cases that actually present no problem
    that would require any workaround. GLP and GSP result from complex life-
    contingencies calculations that cannot degrade to simple arithmetic on
    integers, and therefore the pattern of their trailing digits shows no
    no preference for error terms close to zero cents.
---
 ihs_basicval.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index ef273b05..7595b912 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -1039,7 +1039,7 @@ currency BasicValues::GetModalPremGLP
 // term rider, dumpin
 
     z /= a_mode;
-    return round_max_premium().c(ldbl_eps_plus_one_times(z));
+    return round_max_premium().c(z);
 }
 
 //============================================================================
@@ -1062,7 +1062,7 @@ currency BasicValues::GetModalPremGSP
 // term rider, dumpin
 
     z /= a_mode;
-    return round_max_premium().c(ldbl_eps_plus_one_times(z));
+    return round_max_premium().c(z);
 }
 
 /// Calculate a monthly-deduction discount factor on the fly.



reply via email to

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