diff options
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/math.cxx | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx index 88354763b2b4..75981d970d74 100644 --- a/sal/rtl/math.cxx +++ b/sal/rtl/math.cxx @@ -865,7 +865,7 @@ double stringToDouble(CharT const * pBegin, CharT const * pEnd, && (CharT('N') == p[2])) { p += 3; - rtl::math::setNan( &fVal ); + fVal = std::numeric_limits<double>::quiet_NaN(); bDone = true; } else if ((CharT('I') == p[0]) && (CharT('N') == p[1]) @@ -1012,19 +1012,8 @@ double stringToDouble(CharT const * pBegin, CharT const * pEnd, { // "1.#NAN", "+1.#NAN", "-1.#NAN" p += 4; - rtl::math::setNan( &fVal ); - if (bSign) - { - union { - double sd; - sal_math_Double md; - } m; - - m.sd = fVal; - m.md.w32_parts.msw |= 0x80000000; // create negative NaN - fVal = m.sd; - bSign = false; // don't negate again - } + fVal = std::numeric_limits<double>::quiet_NaN(); + // bSign will cause negation of fVal in the end, producing a negative NAN. // Eat any further digits: while (p != pEnd && rtl::isAsciiDigit(*p)) @@ -1443,11 +1432,7 @@ double SAL_CALL rtl_math_acosh(double fX) SAL_THROW_EXTERN_C() { volatile double fZ = fX - 1.0; if (fX < 1.0) - { - double fResult; - ::rtl::math::setNan( &fResult ); - return fResult; - } + return std::numeric_limits<double>::quiet_NaN(); if ( fX == 1.0 ) return 0.0; |