diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-07-03 14:39:51 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-07-03 14:39:51 -0400 |
commit | 5492d72c249bebdb9e76ef80dd724ddde8215cdd (patch) | |
tree | 0fbab00444da3bd657511788c3baed3525ae9b5d | |
parent | bc331ec7ca22109b596f0176e8adb1b97fcbcd8e (diff) | |
download | vecmathlib-5492d72c249bebdb9e76ef80dd724ddde8215cdd.zip vecmathlib-5492d72c249bebdb9e76ef80dd724ddde8215cdd.tar.gz |
Correct frexp and ilogb tests
-rw-r--r-- | test.cc | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1032,7 +1032,7 @@ struct vecmathlib_test { static int_t local_frexp1(real_t x) { if (isinf(x)) return std::numeric_limits<int_t>::max(); - if (isnan(x)) return std::numeric_limits<int_t>::max(); + if (isnan(x)) return std::numeric_limits<int_t>::min(); int r; std::frexp(x, &r); return r; @@ -1051,7 +1051,8 @@ struct vecmathlib_test { static int_t local_ilogb(real_t x) { if (x==R(0.0)) return std::numeric_limits<int_t>::min(); - if (isnan(x)) return std::numeric_limits<int_t>::max(); + if (isinf(x)) return std::numeric_limits<int_t>::max(); + if (isnan(x)) return std::numeric_limits<int_t>::min(); return std::ilogb(x); } static real_t local_ldexp(real_t x, int_t n) { return ldexp(x, n); } |