summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-07-03 14:39:51 -0400
committerErik Schnetter <schnetter@gmail.com>2013-07-03 14:39:51 -0400
commit5492d72c249bebdb9e76ef80dd724ddde8215cdd (patch)
tree0fbab00444da3bd657511788c3baed3525ae9b5d
parentbc331ec7ca22109b596f0176e8adb1b97fcbcd8e (diff)
downloadvecmathlib-5492d72c249bebdb9e76ef80dd724ddde8215cdd.zip
vecmathlib-5492d72c249bebdb9e76ef80dd724ddde8215cdd.tar.gz
Correct frexp and ilogb tests
-rw-r--r--test.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/test.cc b/test.cc
index c84465b..308b0ab 100644
--- a/test.cc
+++ b/test.cc
@@ -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); }
OpenPOWER on IntegriCloud