lmi-commits
[Top][All Lists]
Advanced

[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
         );



reply via email to

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