diff options
Diffstat (limited to 'vec_float_sse2_scalar.h')
-rw-r--r-- | vec_float_sse2_scalar.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vec_float_sse2_scalar.h b/vec_float_sse2_scalar.h index e39a324..def48fa 100644 --- a/vec_float_sse2_scalar.h +++ b/vec_float_sse2_scalar.h @@ -396,7 +396,13 @@ namespace vecmathlib { } realvec fmod(realvec y) const { return std::fmod(v, y.v); } realvec hypot(realvec y) const { return MF::vml_hypot(*this, y); } - intvec_t ilogb() const { return std::ilogb(v); } + intvec_t ilogb() const + { + int_t r = std::ilogb(v); + if (r == FP_ILOGB0) r = numeric_limits<int_t>::min(); + else if (r == FP_ILOGBNAN) r = numeric_limits<int_t>::max(); + return r; + } boolvec_t isfinite() const { return std::isfinite(v); } boolvec_t isinf() const { return std::isinf(v); } boolvec_t isnan() const { return std::isnan(v); } |