From 4330085f141327ee494bb541d4f2f291dd1c590b Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 22 May 2014 18:29:35 +0200 Subject: Avoid undef conversion from log10(INF) = INF to sal_Int32 Change-Id: Iffe85763097829cb04b766314077b5f2a9b5b8d5 --- sal/qa/inc/valueequal.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sal/qa/inc') diff --git a/sal/qa/inc/valueequal.hxx b/sal/qa/inc/valueequal.hxx index 2f39594529a6..563314d9e82e 100644 --- a/sal/qa/inc/valueequal.hxx +++ b/sal/qa/inc/valueequal.hxx @@ -17,8 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include +#include + #define PREC_float 1 #define PREC_double 2 #define PREC_long_double 3 @@ -26,6 +30,10 @@ template bool is_equal(T x, T y, sal_Int16 _nPrec) { + if (!(SAL_MATH_FINITE(x) && SAL_MATH_FINITE(y))) { + return x == y; + } + // due to the fact that this check looks only if both values are equal // we only need to look on one value -- cgit v1.2.3