diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-29 08:39:21 +0600 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-29 05:43:38 +0100 |
commit | 0ccf447843b3a94e1a6b09e5f123f9636e24d78a (patch) | |
tree | f7c5a0b3398d5abcc0a7b54737dc0d9bb74eeafc /sal | |
parent | c2dca161c0ed455a962d23f8e2fcb64143c5e674 (diff) |
Simplify a bit
Change-Id: I90e26030cb7a002bfd76cbc7aa73a5d3ea7a7f1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164132
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/rtl/math.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx index 5b6c780b5001..766bde5d92b9 100644 --- a/sal/rtl/math.cxx +++ b/sal/rtl/math.cxx @@ -397,8 +397,7 @@ double stringToDouble(CharT const* pBegin, CharT const* pEnd, CharT cDecSeparato // overflow also if more than DBL_MAX_10_EXP digits without decimal // separator, or 0. and more than DBL_MIN_10_EXP digits, ... - bool bHuge = fVal == HUGE_VAL; // g++ 3.0.1 requires it this way... - if (bHuge) + if (std::isinf(fVal)) eStatus = rtl_math_ConversionStatus_OutOfRange; if (bSign) @@ -581,7 +580,7 @@ double SAL_CALL rtl_math_pow10Exp(double fValue, int nExp) SAL_THROW_EXTERN_C() double SAL_CALL rtl_math_approxValue(double fValue) SAL_THROW_EXTERN_C() { const double fBigInt = 0x1p41; // 2^41 -> only 11 bits left for fractional part, fine as decimal - if (fValue == 0.0 || fValue == HUGE_VAL || !std::isfinite(fValue) || fValue > fBigInt) + if (fValue == 0.0 || !std::isfinite(fValue) || fValue > fBigInt) { // We don't handle these conditions. Bail out. return fValue; |