sal/rtl/math.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
New commits: commit 0ccf447843b3a94e1a6b09e5f123f9636e24d78a Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Feb 29 08:39:21 2024 +0600 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Feb 29 05:43:38 2024 +0100 Simplify a bit Change-Id: I90e26030cb7a002bfd76cbc7aa73a5d3ea7a7f1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164132 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> 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;