From 862802c1eff0906c8469fd393a4100020467218a Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Wed, 3 Jul 2013 14:38:58 -0400 Subject: More ilogb corrections --- vec_pseudo.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'vec_pseudo.h') diff --git a/vec_pseudo.h b/vec_pseudo.h index 1e78fb7..b8aa808 100644 --- a/vec_pseudo.h +++ b/vec_pseudo.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -750,13 +751,14 @@ namespace vecmathlib { { realvec_t res; for (int d=0; d::max(); #endif #if defined VML_HAVE_NAN - if (std::isnan(v[d])) ir = std::numeric_limits::max(); + if (std::isnan(v[d])) ir = std::numeric_limits::min(); #endif res.v[d] = r; ires.v[d] = ir; @@ -772,10 +774,14 @@ namespace vecmathlib { typedef std::numeric_limits NL; if (FP_ILOGB0 != NL::min() and v[d] == R(0.0)) { r = NL::min(); -#if defined VML_HAVE_NAN - } else if (FP_ILOGBNAN != NL::max() and std::isnan(v[d])) { +#if defined VML_HAVE_INF + } else if (INT_MAX != NL::max() and std::isinf(v[d])) { r = NL::max(); #endif +#if defined VML_HAVE_NAN + } else if (FP_ILOGBNAN != NL::min() and std::isnan(v[d])) { + r = NL::min(); +#endif } res.v[d] = r; } -- cgit v1.1