Use proper bool operations

Change-Id: I6aa9cf5cb7fde0a0bb2902a0b2a9e091ed6d94ab
This commit is contained in:
Stephan Bergmann
2014-01-10 11:32:55 +01:00
parent 81cb6a7fbc
commit ed6a2f3bb9

View File

@@ -319,7 +319,7 @@ inline double approxCeil(double a)
*/ */
inline bool isFinite(double d) inline bool isFinite(double d)
{ {
return SAL_MATH_FINITE(d) != 0; return SAL_MATH_FINITE(d);
} }
/** If a value represents +INF or -INF. /** If a value represents +INF or -INF.
@@ -331,7 +331,7 @@ inline bool isFinite(double d)
inline bool isInf(double d) inline bool isInf(double d)
{ {
// exponent==0x7ff fraction==0 // exponent==0x7ff fraction==0
return (SAL_MATH_FINITE(d) == 0) && return !SAL_MATH_FINITE(d) &&
(reinterpret_cast< sal_math_Double * >(&d)->inf_parts.fraction_hi == 0) (reinterpret_cast< sal_math_Double * >(&d)->inf_parts.fraction_hi == 0)
&& (reinterpret_cast< sal_math_Double * >(&d)->inf_parts.fraction_lo && (reinterpret_cast< sal_math_Double * >(&d)->inf_parts.fraction_lo
== 0); == 0);
@@ -342,7 +342,7 @@ inline bool isInf(double d)
inline bool isNan(double d) inline bool isNan(double d)
{ {
// exponent==0x7ff fraction!=0 // exponent==0x7ff fraction!=0
return (SAL_MATH_FINITE(d) == 0) && ( return !SAL_MATH_FINITE(d) && (
(reinterpret_cast< sal_math_Double * >(&d)->inf_parts.fraction_hi != 0) (reinterpret_cast< sal_math_Double * >(&d)->inf_parts.fraction_hi != 0)
|| (reinterpret_cast< sal_math_Double * >(&d)->inf_parts.fraction_lo || (reinterpret_cast< sal_math_Double * >(&d)->inf_parts.fraction_lo
!= 0) ); != 0) );