lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master c01b9b0 02/22: Improve concinnity


From: Greg Chicares
Subject: [lmi-commits] [lmi] master c01b9b0 02/22: Improve concinnity
Date: Sun, 6 Jun 2021 21:37:59 -0400 (EDT)

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

    Improve concinnity
---
 zero.hpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/zero.hpp b/zero.hpp
index 8b69e4c..b3ec634 100644
--- a/zero.hpp
+++ b/zero.hpp
@@ -258,19 +258,19 @@ root_type decimal_root
     ,std::ostream&   os_trace = null_stream()
     )
 {
-    os_trace.precision(DECIMAL_DIG);
+    static constexpr double epsilon   {std::numeric_limits<double>::epsilon()};
 
-    static double const epsilon = std::numeric_limits<double>::epsilon();
+    round_to<double> const round_dec  {decimals, r_to_nearest};
 
     int number_of_iterations          {0};
     interpolation_technique technique {interpolate_initialization};
 
-    double t = 0.5 * std::pow(10.0, -decimals);
+    os_trace.precision(DECIMAL_DIG);
 
-    round_to<double> const round_(decimals, r_to_nearest);
+    double t = 0.5 * std::pow(10.0, -decimals);
 
-    double a = round_(bound0);
-    double b = round_(bound1);
+    double a = round_dec(bound0);
+    double b = round_dec(bound1);
 
     double fa = static_cast<double>(f(a));
     detail::expatiate(number_of_iterations, os_trace, technique, a, fa);
@@ -391,7 +391,7 @@ root_type decimal_root
             {
             b -= tol;
             }
-        b = round_(b);
+        b = round_dec(b);
 
         if(b == a) // Note 4.
             {



reply via email to

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