lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master b6752650 02/11: Improve documentation


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

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

    Improve documentation
    
    Don't refer to std::pow() in comments within files that don't use it
    directly, so that `git grep -l '\<std::pow\>'` finds only actual
    invocations. In many cases, nonstd::power() or a combination of
    expm1() and log1p() is more accurate, and using std::pow() instead is
    therefore a defect.
---
 interest_rates.cpp | 2 +-
 monnaie.hpp        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/interest_rates.cpp b/interest_rates.cpp
index 6e781601..b086d6a9 100644
--- a/interest_rates.cpp
+++ b/interest_rates.cpp
@@ -92,7 +92,7 @@ namespace
 // 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); therefore, i_upper_12_over_12_from_i<>()
-// is used instead of std::pow().
+// is used instead of 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/monnaie.hpp b/monnaie.hpp
index 96b783b9..8417694e 100644
--- a/monnaie.hpp
+++ b/monnaie.hpp
@@ -62,7 +62,7 @@ class monnaie
     using amount_type = std::int_fast64_t;
 
     static constexpr int cents_digits = 2;
-    static constexpr int cents_per_dollar = 100; // std::pow(10, cents_digits)
+    static constexpr int cents_per_dollar = 100; // pow(10, cents_digits)
 
     static constexpr amount_type max_dollars()
         {



reply via email to

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