lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master f6dc8a5 3/5: Improve a local-variable name


From: Greg Chicares
Subject: [lmi-commits] [lmi] master f6dc8a5 3/5: Improve a local-variable name
Date: Tue, 6 Jun 2017 17:30:29 -0400 (EDT)

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

    Improve a local-variable name
    
    What had been called 'u' (a personal convention: u = 1/v = 1+i) was
    actually v upper twelve, so it was renamed to 'v12' for clarity.
    
    Incidentally improved const-correctness.
---
 ihs_basicval.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index 7fef5ba..8d320da 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -1217,8 +1217,8 @@ double BasicValues::GetModalPremMlyDedEe
 
     z /= 1.0 - Loads_->target_premium_load_maximum_premium_tax()[a_year];
 
-    double u = DBDiscountRate[a_year];
-    z *= (1.0 - std::pow(u, 12.0 / a_mode)) / (1.0 - u);
+    double const v12 = DBDiscountRate[a_year];
+    z *= (1.0 - std::pow(v12, 12.0 / a_mode)) / (1.0 - v12);
 
 #if 0
     z += annual_charge;
@@ -1296,8 +1296,8 @@ double BasicValues::GetModalPremMlyDedEr
 
     z /= 1.0 - Loads_->target_premium_load_maximum_premium_tax()[a_year];
 
-    double u = DBDiscountRate[a_year];
-    z *= (1.0 - std::pow(u, 12.0 / a_mode)) / (1.0 - u);
+    double const v12 = DBDiscountRate[a_year];
+    z *= (1.0 - std::pow(v12, 12.0 / a_mode)) / (1.0 - v12);
 
     z += annual_charge;
 
@@ -1489,15 +1489,15 @@ double BasicValues::GetAnnuityValueMlyDed(int a_year, 
mcenum_mode a_mode) const
         (   yare_input_.GeneralAccountRate[a_year]
         -   spread
         );
-    double u = 1.0 + std::max
+    double const u = 1.0 + std::max
         (z
         ,InterestRates_->GenAcctNetRate
             (mce_gen_guar
             ,mce_monthly_rate
             )[a_year]
         );
-    u = 1.0 / u;
-    return (1.0 - std::pow(u, 12.0 / a_mode)) / (1.0 - u);
+    double const v12 = 1.0 / u;
+    return (1.0 - std::pow(v12, 12.0 / a_mode)) / (1.0 - v12);
 }
 
 /// This forwarding function prevents the 'actuarial_table' module



reply via email to

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