lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 5db4eff 2/2: Set product-database default lim


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 5db4eff 2/2: Set product-database default limits more consistently
Date: Mon, 18 Feb 2019 12:46:25 -0500 (EST)

branch: master
commit 5db4effb534a9e1c3830f58f2b0e189c86af76b7
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Set product-database default limits more consistently
    
    Formerly, DB_AdbLimit defaulted to positive infinity, whereas
    DB_SpouseRiderMaxAmt defaulted to a 309-digit integer. Now that large
    finite integer is no longer used. Floating-point operations involving
    infinities may be quite slow, with penalties ranging from hundreds of
    cycles for some x87 hardware to none at all for SSE; but reading 309
    characters from a file and converting them to an integer surely costs
    more than reading and converting the string "inf".
---
 dbdict.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/dbdict.cpp b/dbdict.cpp
index a4afec0..74f76ae 100644
--- a/dbdict.cpp
+++ b/dbdict.cpp
@@ -45,7 +45,6 @@
 #include <boost/filesystem/operations.hpp>
 #include <boost/filesystem/path.hpp>
 
-#include <limits>
 #include <vector>
 
 template class xml_serializable<DBDictionary>;
@@ -517,7 +516,6 @@ void DBDictionary::Add(database_entity const& e)
 void DBDictionary::InitDB()
 {
     static double const dbl_inf = infinity<double>();
-    static double const bignum = std::numeric_limits<double>::max();
 
     for(auto const& i : member_names())
         {
@@ -577,15 +575,14 @@ void DBDictionary::InitDB()
     Add({DB_WpLimit               , dbl_inf});
     Add({DB_AdbLimit              , dbl_inf});
     Add({DB_ExpSpecAmtLimit       , dbl_inf});
+    Add({DB_SpouseRiderMaxAmt     , dbl_inf});
+    Add({DB_ChildRiderMaxAmt      , dbl_inf});
 
     Add({DB_MaxIssSpecAmt         , dbl_inf});
     Add({DB_MaxRenlSpecAmt        , dbl_inf});
 
-    // These are the same as the nominal limits of the associated
-    // members of class Input.
-    Add({DB_SpouseRiderMaxAmt     , bignum});
+    // This is the same as class age_trammel's nominal upper limit.
     Add({DB_SpouseRiderMaxIssAge  , 99});
-    Add({DB_ChildRiderMaxAmt      , bignum});
 
     // These are plausible defaults that often evaluate to zero, but
     // are initialized here with appropriate enumerators to make the



reply via email to

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