lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 4d1b7487 3/8: Improve a local name


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 4d1b7487 3/8: Improve a local name
Date: Mon, 6 Jun 2022 18:40:33 -0400 (EDT)

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

    Improve a local name
    
    If 'exponent' is -5, then
      'negative_exponent' suggests "+5", but
      'is_exponent_negative' clearly means "true".
---
 bin_exp.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin_exp.hpp b/bin_exp.hpp
index 8188d608..157b994a 100644
--- a/bin_exp.hpp
+++ b/bin_exp.hpp
@@ -64,7 +64,7 @@ template<typename T>
 constexpr T bin_exp(T x, int exponent)
 {
     static_assert(std::is_floating_point_v<T>);
-    bool negative_exponent {exponent < 0};
+    bool is_exponent_negative {exponent < 0};
     unsigned int n = u_abs(exponent);
     T y = 1;
     for(;;)
@@ -76,7 +76,7 @@ constexpr T bin_exp(T x, int exponent)
             break;
         x *= x;
         }
-    return negative_exponent ? 1 / y : y;
+    return is_exponent_negative ? 1 / y : y;
 }
 
 double Algorithm_A(double x, int n);



reply via email to

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