lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 6ad24c51 2/5: Refactor


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6ad24c51 2/5: Refactor
Date: Wed, 18 May 2022 15:54:20 -0400 (EDT)

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

    Refactor
    
    Specify a floating-literal OAOO.
---
 math_functions_test.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/math_functions_test.cpp b/math_functions_test.cpp
index db3c15ae..1931d623 100644
--- a/math_functions_test.cpp
+++ b/math_functions_test.cpp
@@ -159,6 +159,7 @@ struct i_upper_n_over_n_from_i_T
 
 void sample_results()
 {
+    constexpr double intrate {0.01};
     fenv_initialize();
     std::cout.setf(std::ios_base::fixed, std::ios_base::floatfield);
     std::cout.precision(25);
@@ -167,16 +168,16 @@ void sample_results()
         << ", by various methods:\n"
         << "        000000000111111111122\n"
         << "        123456789012345678901\n"
-        << "  " << i_upper_n_over_n_from_i      <long double,365>()(0.01)
+        << "  " << i_upper_n_over_n_from_i      <long double,365>()(intrate)
         << "  method in production\n"
         ;
 #if defined LMI_X87
     fenv_precision(fe_ldblprec);
 #endif // defined LMI_X87
     std::cout
-        << "  " << i_upper_n_over_n_from_i_T    <long double,365>()(0.01)
+        << "  " << i_upper_n_over_n_from_i_T    <long double,365>()(intrate)
         << "  long double precision, std::expm1 and std::log1p\n"
-        << "  " << i_upper_n_over_n_from_i_naive<long double,365>()(0.01)
+        << "  " << i_upper_n_over_n_from_i_naive<long double,365>()(intrate)
         << "  long double precision, std::pow\n"
         ;
 #if defined LMI_X87
@@ -184,9 +185,9 @@ void sample_results()
     fenv_precision(fe_dblprec);
 #endif // defined LMI_X87
     std::cout
-        << "  " << i_upper_n_over_n_from_i_T    <double,365>()(0.01)
+        << "  " << i_upper_n_over_n_from_i_T    <double,365>()(intrate)
         << "  double precision, std::expm1 and std::log1p\n"
-        << "  " << i_upper_n_over_n_from_i_naive<double,365>()(0.01)
+        << "  " << i_upper_n_over_n_from_i_naive<double,365>()(intrate)
         << "  double precision, std::pow\n"
         ;
 



reply via email to

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