[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master a8e24b0 6/7: Rectify a strange test for infin
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master a8e24b0 6/7: Rectify a strange test for infinity |
Date: |
Thu, 4 Feb 2021 16:44:33 -0500 (EST) |
branch: master
commit a8e24b024230710f5b133d6556220668f718ed7d
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Rectify a strange test for infinity
For banded COI rates, the band breaks default to infinity:
dbdict.cpp: Add({DB_CurrCoiTable0Limit , dbl_inf});
dbdict.cpp: Add({DB_CurrCoiTable1Limit , dbl_inf});
[where dbl_inf is defined as infinity<double>()], but they were tested
against DBL_MAX. That happened to do the right thing, because no actual
specified amount is between DBL_MAX and infinity, but it was unclean.
---
ihs_basicval.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index bea8ebc..0d40081 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -1959,7 +1959,7 @@ std::vector<double> BasicValues::GetCurrCOIRates1() const
return GetTable
(product().datum("CurrCOIFilename")
,DB_CurrCoiTable1
- ,CurrCoiTable0Limit < std::numeric_limits<double>::max()
+ ,!isinf(CurrCoiTable0Limit)
,CanBlend
,CanBlend
);
@@ -1970,7 +1970,7 @@ std::vector<double> BasicValues::GetCurrCOIRates2() const
return GetTable
(product().datum("CurrCOIFilename")
,DB_CurrCoiTable2
- ,CurrCoiTable1Limit < std::numeric_limits<double>::max()
+ ,!isinf(CurrCoiTable1Limit)
,CanBlend
,CanBlend
);
- [lmi-commits] [lmi] master updated (53a8634 -> 62c89fd), Greg Chicares, 2021/02/04
- [lmi-commits] [lmi] master 8738f07 5/7: Improve concinnity of database descriptions, Greg Chicares, 2021/02/04
- [lmi-commits] [lmi] master a8e24b0 6/7: Rectify a strange test for infinity,
Greg Chicares <=
- [lmi-commits] [lmi] master 62c89fd 7/7: Use currency type for some potentially-infinite limits, Greg Chicares, 2021/02/04
- [lmi-commits] [lmi] master 2cf0e24 1/7: Overload query_into() for currency, Greg Chicares, 2021/02/04
- [lmi-commits] [lmi] master 0d94134 2/7: Note a possible improvement, Greg Chicares, 2021/02/04
- [lmi-commits] [lmi] master dcc33f1 3/7: Replace a free function with a better general implementation, Greg Chicares, 2021/02/04
- [lmi-commits] [lmi] master 48aa040 4/7: Use recently added query_into() overload for currency, Greg Chicares, 2021/02/04