diff options
author | Antonio Sanchez <cantonios@google.com> | 2021-03-16 20:12:46 -0700 |
---|---|---|
committer | Antonio Sanchez <cantonios@google.com> | 2021-03-16 20:12:46 -0700 |
commit | 8dfe1029a5012774d50bfc39569e49e34d3152e0 (patch) | |
tree | 699510b229742363b7c51d416815de69affaa04a /bench | |
parent | eb71e5db988d4a23e619ed054efd3eb751cdd026 (diff) |
Augment NumTraits with min/max_exponent() again.
Replace usage of `std::numeric_limits<...>::min/max_exponent` in
codebase where possible. Also replaced some other `numeric_limits`
usages in affected tests with the `NumTraits` equivalent.
The previous MR !443 failed for c++03 due to lack of `constexpr`.
Because of this, we need to keep around the `std::numeric_limits`
version in enum expressions until the switch to c++11.
Fixes #2148
Diffstat (limited to 'bench')
-rw-r--r-- | bench/bench_norm.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bench/bench_norm.cpp b/bench/bench_norm.cpp index a86153945..592f25d66 100644 --- a/bench/bench_norm.cpp +++ b/bench/bench_norm.cpp @@ -111,12 +111,12 @@ EIGEN_DONT_INLINE typename T::Scalar pblueNorm(const T& v) int nbig, ibeta, it, iemin, iemax, iexp; Scalar abig, eps; - nbig = std::numeric_limits<int>::max(); // largest integer - ibeta = std::numeric_limits<Scalar>::radix; //NumTraits<Scalar>::Base; // base for floating-point numbers - it = std::numeric_limits<Scalar>::digits; //NumTraits<Scalar>::Mantissa; // number of base-beta digits in mantissa - iemin = std::numeric_limits<Scalar>::min_exponent; // minimum exponent - iemax = std::numeric_limits<Scalar>::max_exponent; // maximum exponent - rbig = std::numeric_limits<Scalar>::max(); // largest floating-point number + nbig = NumTraits<int>::highest(); // largest integer + ibeta = std::numeric_limits<Scalar>::radix; // NumTraits<Scalar>::Base; // base for floating-point numbers + it = NumTraits<Scalar>::digits(); // NumTraits<Scalar>::Mantissa; // number of base-beta digits in mantissa + iemin = NumTraits<Scalar>::min_exponent(); // minimum exponent + iemax = NumTraits<Scalar>::max_exponent(); // maximum exponent + rbig = NumTraits<Scalar>::highest(); // largest floating-point number // Check the basic machine-dependent constants. if(iemin > 1 - 2*it || 1+it>iemax || (it==2 && ibeta<5) |