[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);
- [lmi-commits] [lmi] master updated (a0472892 -> 9be3fe4e), Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 43c26210 2/8: Make a unit test more thorough, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 9be3fe4e 8/8: Update dotfiles, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 4d1b7487 3/8: Improve a local name,
Greg Chicares <=
- [lmi-commits] [lmi] master d7249cec 1/8: Test whether macros were already defined, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 8f25a9bd 5/8: Resolve an issue identified by UBSAN, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master fe203b1e 4/8: Use undefined-behavior sanitizer, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master cc85be94 6/8: Resolve another issue identified by UBSAN, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 7ae73fae 7/8: Localize an 'f2c' global, Greg Chicares, 2022/06/06