lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 43bbe463 05/11: Use lmi::expm1() and lmi::log


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 43bbe463 05/11: Use lmi::expm1() and lmi::log1p() in a unit-test function
Date: Thu, 26 May 2022 18:14:25 -0400 (EDT)

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

    Use lmi::expm1() and lmi::log1p() in a unit-test function
    
    Production uses 'double' expm1() and log1p(), rather than 'long double'
    as the comment previously said.
---
 math_functions_test.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/math_functions_test.cpp b/math_functions_test.cpp
index 26434ad0..bd6a84ed 100644
--- a/math_functions_test.cpp
+++ b/math_functions_test.cpp
@@ -133,8 +133,8 @@ struct i_upper_n_over_n_from_i_naive
         }
 };
 
-// This implementation uses std::expm1() and std::log1p() for type T,
-// rather than the long double functions used in production.
+// This implementation uses lmi::expm1() and lmi::log1p() for type T,
+// whereas production uses those functions for type 'double' only.
 
 template<typename T, int n>
 struct i_upper_n_over_n_from_i_T
@@ -143,7 +143,7 @@ struct i_upper_n_over_n_from_i_T
     T operator()(T const& i) const
         {
         static T const reciprocal_n = T(1) / n;
-        return std::expm1(std::log1p(i) * reciprocal_n);
+        return lmi::expm1(lmi::log1p(i) * reciprocal_n);
         }
 };
 } // Unnamed namespace.



reply via email to

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