[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.
- [lmi-commits] [lmi] master updated (13799952 -> 9e5a09bf), Greg Chicares, 2022/05/06
- [lmi-commits] [lmi] master be841c05 3/9: Refactor for clarity, Greg Chicares, 2022/05/06
- [lmi-commits] [lmi] master a24d665c 4/9: Include only appropriate headers, and say why they're included, Greg Chicares, 2022/05/06
- [lmi-commits] [lmi] master 46534540 2/9: Refactor for uniformity, Greg Chicares, 2022/05/06
- [lmi-commits] [lmi] master 9e5a09bf 9/9: Record speed measurements, Greg Chicares, 2022/05/06
- [lmi-commits] [lmi] master 78657d01 6/9: Improve physical structure, Greg Chicares, 2022/05/06
- [lmi-commits] [lmi] master 4b8bf312 1/9: Expunge workarounds for nonexistent problems,
Greg Chicares <=
- [lmi-commits] [lmi] master 67af2e9b 5/9: Improve a debatable workaround, Greg Chicares, 2022/05/06
- [lmi-commits] [lmi] master 205497ae 8/9: Reimplement max_modal_premium(), Greg Chicares, 2022/05/06
- [lmi-commits] [lmi] master 1de83b9d 7/9: Refactor, Greg Chicares, 2022/05/06