diff options
author | Antonio Sanchez <cantonios@google.com> | 2021-02-12 13:14:05 -0800 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2021-03-17 01:00:41 +0000 |
commit | 75ce9cd2a7aefaaea8543e2db14ce4dc149eeb03 (patch) | |
tree | 1fa930f172e73b119f98409258a2993804ecb9dc /bench | |
parent | 9fb7062440cc4afc342a757b1c746fc816ee9dd5 (diff) |
Augment NumTraits with min/max_exponent().
Replace usage of `std::numeric_limits<...>::min/max_exponent` in
codebase. Also replaced some other `numeric_limits` usages in
affected tests with the `NumTraits` equivalent.
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) |