static const -> static constexpr where we can.

Change-Id: I8a6d26a89c4377dd440fa6dcf23513b7556533fc
This commit is contained in:
Sameer Agarwal
2020-04-21 10:10:01 -07:00
parent 40b27482a2
commit 57cf20aa5d
12 changed files with 26 additions and 24 deletions
+3 -1
View File
@@ -102,7 +102,9 @@ void TolerantLoss::Evaluate(double s, double rho[3]) const {
// large, it will overflow. Since numerically 1 + e^x == e^x when the
// x is greater than about ln(2^53) for doubles, beyond this threshold
// we substitute x for ln(1 + e^x) as a numerically equivalent approximation.
static const double kLog2Pow53 = 36.7; // ln(MathLimits<double>::kEpsilon).
// ln(MathLimits<double>::kEpsilon).
static constexpr double kLog2Pow53 = 36.7;
if (x > kLog2Pow53) {
rho[0] = s - a_ - c_;
rho[1] = 1.0;