summaryrefslogtreecommitdiffstats
path: root/vec_sse_float1.h
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-07-03 14:38:58 -0400
committerErik Schnetter <schnetter@gmail.com>2013-07-03 14:38:58 -0400
commit862802c1eff0906c8469fd393a4100020467218a (patch)
treef9241f1fca7cc749e50e6256ac3ee8b64bc36235 /vec_sse_float1.h
parenta5b17dbe53dad4e548a41180d2e907601400c031 (diff)
downloadvecmathlib-862802c1eff0906c8469fd393a4100020467218a.zip
vecmathlib-862802c1eff0906c8469fd393a4100020467218a.tar.gz
More ilogb corrections
Diffstat (limited to 'vec_sse_float1.h')
-rw-r--r--vec_sse_float1.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/vec_sse_float1.h b/vec_sse_float1.h
index 2ef20bd..53b114c 100644
--- a/vec_sse_float1.h
+++ b/vec_sse_float1.h
@@ -8,6 +8,7 @@
#include "vec_base.h"
#include <cmath>
+#include <climits>
// SSE2 intrinsics
#include <emmintrin.h>
@@ -423,7 +424,7 @@ namespace vecmathlib {
{
realvec r = std::frexp(v, &ir.v);
if (isinf()) ir.v = std::numeric_limits<int_t>::max();
- if (isnan()) ir.v = std::numeric_limits<int_t>::max();
+ if (isnan()) ir.v = std::numeric_limits<int_t>::min();
return r;
}
realvec hypot(realvec y) const { return MF::vml_hypot(*this, y); }
@@ -433,10 +434,14 @@ namespace vecmathlib {
typedef std::numeric_limits<int_t> NL;
if (FP_ILOGB0 != NL::min() and *this == RV(R(0.0))) {
r = NL::min();
-#if defined VML_HAVE_NAN
- } else if (FP_ILOGBNAN != NL::max() and isnan()) {
+#if defined VML_HAVE_INF
+ } else if (INT_MAX != NL::max() and std::isinf(v)) {
r = NL::max();
#endif
+#if defined VML_HAVE_NAN
+ } else if (FP_ILOGBNAN != NL::min() and isnan()) {
+ r = NL::min();
+#endif
}
return r;
}
OpenPOWER on IntegriCloud