[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 1999149 2/3: Fix defect introduced 20080901T1
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 1999149 2/3: Fix defect introduced 20080901T1318Z: superfluous parentheses |
Date: |
Tue, 2 Apr 2019 07:23:55 -0400 (EDT) |
branch: master
commit 19991496bae761313a9086d1d227a94c58ed4767
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Fix defect introduced 20080901T1318Z: superfluous parentheses
A former macro had been converted to a function template, making the
parentheses surrounding (macro) arguments superfluous, but those
parentheses weren't removed.
---
zero_test.cpp | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/zero_test.cpp b/zero_test.cpp
index 9692117..4de26fe 100644
--- a/zero_test.cpp
+++ b/zero_test.cpp
@@ -36,9 +36,9 @@ namespace
template<typename F>
void test_zero(double bound0, double bound1, int dec, F f, double exact_root)
{
- root_type rn = decimal_root((bound0), (bound1), bias_none, (dec), (f));
- root_type rl = decimal_root((bound0), (bound1), bias_lower, (dec), (f));
- root_type rh = decimal_root((bound0), (bound1), bias_higher, (dec), (f));
+ root_type rn = decimal_root(bound0, bound1, bias_none, dec, f);
+ root_type rl = decimal_root(bound0, bound1, bias_lower, dec, f);
+ root_type rh = decimal_root(bound0, bound1, bias_higher, dec, f);
BOOST_TEST(root_is_valid == rn.second);
BOOST_TEST(root_is_valid == rl.second);
@@ -47,7 +47,7 @@ void test_zero(double bound0, double bound1, int dec, F f,
double exact_root)
BOOST_TEST(rl.first <= rn.first && rn.first <= rh.first);
double tol =
- std::pow(10.0, -(dec))
+ std::pow(10.0, -dec)
+ 6.0 * epsilon * std::max
(std::fabs(rl.first), std::fabs(rh.first)
)
@@ -55,16 +55,16 @@ void test_zero(double bound0, double bound1, int dec, F f,
double exact_root)
BOOST_TEST((rh.first - rl.first) <= tol);
double toll =
- std::pow(10.0, -(dec))
+ std::pow(10.0, -dec)
+ 6.0 * epsilon * std::fabs(rl.first)
;
- BOOST_TEST((rl.first - (exact_root)) <= toll);
+ BOOST_TEST((rl.first - exact_root) <= toll);
double tolh =
- std::pow(10.0, -(dec))
+ std::pow(10.0, -dec)
+ 6.0 * epsilon * std::fabs(rh.first)
;
- BOOST_TEST((rh.first - (exact_root)) <= tolh);
+ BOOST_TEST((rh.first - exact_root) <= tolh);
}
double e_function(double z)