lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 699308ab 01/11: Improve documentation


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 699308ab 01/11: Improve documentation
Date: Thu, 26 May 2022 18:14:24 -0400 (EDT)

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

    Improve documentation
    
    Don't refer to std::expm1() and std::log1p() in comments within files
    that don't use them directly, lest those comments become misleading
    when those functions in namespace std are replaced with implementations
    in namespace lmi.
---
 interest_rates.cpp       | 4 ++--
 mortality_rates_test.cpp | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/interest_rates.cpp b/interest_rates.cpp
index e9d357cd..6e781601 100644
--- a/interest_rates.cpp
+++ b/interest_rates.cpp
@@ -91,8 +91,8 @@ namespace
 // For the annual-effective method, transformation from annual to
 // daily and back again by naive methods would lose considerable
 // precision even when the spread and fee are zero, because i is
-// small relative to (1 + i). That is why std::expm1() and
-// std::log1p() are used instead of std::pow().
+// small relative to (1 + i); therefore, i_upper_12_over_12_from_i<>()
+// is used instead of std::pow().
 //
 // If both spread and fee are zero, then the net rate should exactly
 // equal the gross rate. However, those two rates would differ
diff --git a/mortality_rates_test.cpp b/mortality_rates_test.cpp
index d8392228..bdbe723b 100644
--- a/mortality_rates_test.cpp
+++ b/mortality_rates_test.cpp
@@ -58,7 +58,7 @@ std::vector<double> annual_rates()
 ///   qm = 1 - (1-q)^(1/12)
 ///   qm = qm / (1-qm)
 /// diverges even in the tenth significant digit. Values given here
-/// use std::expm1() and std::log1p() for better accuracy.
+/// were generated using coi_rate_from_q<>() for better accuracy.
 
 std::vector<double> monthly_rates()
 {



reply via email to

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