lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 1a3d3e6 6/7: Fix defect introduced 20050114T1


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 1a3d3e6 6/7: Fix defect introduced 20050114T1947Z: used the wrong variable [301]
Date: Mon, 22 Feb 2021 07:46:31 -0500 (EST)

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

    Fix defect introduced 20050114T1947Z: used the wrong variable [301]
    
    The floor for the 7702 interest rate is the guaranteed net loan rate,
    not the loan spread.
    
    * ihs_basicval.cpp: Removed the defect; simplified.
    * dbdict.cpp: Removed a workaround for the herewith-removed defect.
    
    Although this defect was introduced 20050114T1947Z into CVS, it comes
    from an original file predating the lmi epoch.
---
 dbdict.cpp       |  2 --
 ihs_basicval.cpp | 27 +++++++--------------------
 2 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/dbdict.cpp b/dbdict.cpp
index f1d64dc..a7baf1d 100644
--- a/dbdict.cpp
+++ b/dbdict.cpp
@@ -1493,8 +1493,6 @@ sample2xyz::sample2xyz()
     // This is determined by law, in a way that varies by product;
     // 2021 products use this two-percent rate.
     Add({DB_AnnInterestRate7702 , 0.02});
-    // Temporary workaround to sidestep a defect in revived code:
-    Add({DB_IgnoreLoanRateFor7702, true});
     // Arguably the most complex ledger type.
     Add({DB_LedgerType          , mce_finra});
     // Certain group-quote columns are available only when these two
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index ff8f833..dea9429 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -449,26 +449,13 @@ void BasicValues::Init7702()
                 database().query_into(DB_FixedLoanRate    , gross_loan_rate);
                 std::vector<double> guar_loan_spread;
                 database().query_into(DB_GuarRegLoanSpread, guar_loan_spread);
-                // ET !! std::vector<double> guar_loan_rate = gross_loan_rate 
- guar_loan_spread;
-                std::vector<double> guar_loan_rate(Length);
-                std::transform
-                    (gross_loan_rate.begin()
-                    ,gross_loan_rate.end()
-                    ,guar_loan_spread.begin()
-                    ,guar_loan_rate.begin()
-                    ,std::minus<double>()
-                    );
-                // ET !! guar_int = max(guar_int, guar_loan_spread);
-                // TODO ?? But that looks incorrect when written clearly!
-                // Perhaps this old comment:
-                //   APL: guar_int gets guar_int max gross_loan_rate - 
guar_loan_spread
-                // suggests the actual intention.
-                std::transform
-                    (guar_int.begin()
-                    ,guar_int.end()
-                    ,guar_loan_spread.begin()
-                    ,guar_int.begin()
-                    ,greater_of<double>()
+                assign
+                    (guar_int
+                    ,apply_binary
+                        (greater_of<double>()
+                        ,guar_int
+                        ,gross_loan_rate - guar_loan_spread
+                        )
                     );
                 }
                 break;



reply via email to

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