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 /Eigen/src/Core/StableNorm.h | |
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 'Eigen/src/Core/StableNorm.h')
-rw-r--r-- | Eigen/src/Core/StableNorm.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Eigen/src/Core/StableNorm.h b/Eigen/src/Core/StableNorm.h index 04fe0b371..4a3f0cca8 100644 --- a/Eigen/src/Core/StableNorm.h +++ b/Eigen/src/Core/StableNorm.h @@ -134,9 +134,9 @@ blueNorm_impl(const EigenBase<Derived>& _vec) // statements can be replaced static const int ibeta = std::numeric_limits<RealScalar>::radix; // base for floating-point numbers static const int it = NumTraits<RealScalar>::digits(); // number of base-beta digits in mantissa - static const int iemin = std::numeric_limits<RealScalar>::min_exponent; // minimum exponent - static const int iemax = std::numeric_limits<RealScalar>::max_exponent; // maximum exponent - static const RealScalar rbig = (std::numeric_limits<RealScalar>::max)(); // largest floating-point number + static const int iemin = NumTraits<RealScalar>::min_exponent(); // minimum exponent + static const int iemax = NumTraits<RealScalar>::max_exponent(); // maximum exponent + static const RealScalar rbig = NumTraits<RealScalar>::highest(); // largest floating-point number static const RealScalar b1 = RealScalar(pow(RealScalar(ibeta),RealScalar(-((1-iemin)/2)))); // lower boundary of midrange static const RealScalar b2 = RealScalar(pow(RealScalar(ibeta),RealScalar((iemax + 1 - it)/2))); // upper boundary of midrange static const RealScalar s1m = RealScalar(pow(RealScalar(ibeta),RealScalar((2-iemin)/2))); // scaling factor for lower range |