summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vec_pseudo.h10
-rw-r--r--vec_sse_double1.h5
2 files changed, 9 insertions, 6 deletions
diff --git a/vec_pseudo.h b/vec_pseudo.h
index c3658c0..29f2ed0 100644
--- a/vec_pseudo.h
+++ b/vec_pseudo.h
@@ -752,8 +752,9 @@ namespace vecmathlib {
for (int d=0; d<size; ++d) {
int ir;
real_t r = std::frexp(v[d], &ir);
- if (ir == FP_ILOGB0) ir = std::numeric_limits<int_t>::min();
- else if (ir == FP_ILOGBNAN) ir = std::numeric_limits<int_t>::max();
+ typedef std::numeric_limits<int_t> NL;
+ if (FP_ILOGB0 != NL::min() and ir == FP_ILOGB0) ir = NL::min();
+ else if (FP_ILOGBNAN != NL::max() and ir == FP_ILOGBNAN) ir = NL::max();
res.v[d] = r;
ires.v[d] = ir;
}
@@ -765,8 +766,9 @@ namespace vecmathlib {
intvec_t res;
for (int d=0; d<size; ++d) {
int_t r = std::ilogb(v[d]);
- if (r == FP_ILOGB0) r = std::numeric_limits<int_t>::min();
- else if (r == FP_ILOGBNAN) r = std::numeric_limits<int_t>::max();
+ typedef std::numeric_limits<int_t> NL;
+ if (FP_ILOGB0 != NL::min() and r == FP_ILOGB0) r = NL::min();
+ else if (FP_ILOGBNAN != NL::max() and r == FP_ILOGBNAN) r = NL::max();
res.v[d] = r;
}
return res;
diff --git a/vec_sse_double1.h b/vec_sse_double1.h
index e4680d9..a7455f0 100644
--- a/vec_sse_double1.h
+++ b/vec_sse_double1.h
@@ -426,8 +426,9 @@ namespace vecmathlib {
intvec_t ilogb() const
{
int_t r = std::ilogb(v);
- if (r == FP_ILOGB0) r = std::numeric_limits<int_t>::min();
- else if (r == FP_ILOGBNAN) r = std::numeric_limits<int_t>::max();
+ typedef std::numeric_limits<int_t> NL;
+ if (FP_ILOGB0 == NL::min() and r == FP_ILOGB0) r = NL::min();
+ else if (FP_ILOGBNAN == NL::max() and r == FP_ILOGBNAN) r = NL::max();
return r;
}
boolvec_t isfinite() const { return std::isfinite(v); }
OpenPOWER on IntegriCloud