summaryrefslogtreecommitdiffstats
path: root/libcxx/test/numerics/c.math/cmath.pass.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2011-05-13 21:52:40 +0000
committerHoward Hinnant <hhinnant@apple.com>2011-05-13 21:52:40 +0000
commitfb7f07e3bd48e770c419d75e30831716d948fc25 (patch)
treec9b8317130cdfa30df584ff9b4026b9c729f48d6 /libcxx/test/numerics/c.math/cmath.pass.cpp
parent8418fdcd5914db7a33e0f44ebd6b3eb1dc09e945 (diff)
downloadbcm5719-llvm-fb7f07e3bd48e770c419d75e30831716d948fc25.tar.gz
bcm5719-llvm-fb7f07e3bd48e770c419d75e30831716d948fc25.zip
http://llvm.org/bugs/show_bug.cgi?id=9854. Also created an emulated hexfloat literal for use in some of the tests. <sigh> And cleaned up some harmless but irritating warnings in the tests.
llvm-svn: 131318
Diffstat (limited to 'libcxx/test/numerics/c.math/cmath.pass.cpp')
-rw-r--r--libcxx/test/numerics/c.math/cmath.pass.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libcxx/test/numerics/c.math/cmath.pass.cpp b/libcxx/test/numerics/c.math/cmath.pass.cpp
index 84d695e21d9..7fa763b66bb 100644
--- a/libcxx/test/numerics/c.math/cmath.pass.cpp
+++ b/libcxx/test/numerics/c.math/cmath.pass.cpp
@@ -13,6 +13,8 @@
#include <type_traits>
#include <cassert>
+#include "../../hexfloat.h"
+
void test_abs()
{
static_assert((std::is_same<decltype(std::abs((float)0)), float>::value), "");
@@ -1089,7 +1091,7 @@ void test_nextafter()
static_assert((std::is_same<decltype(std::nextafterf(0,0)), float>::value), "");
static_assert((std::is_same<decltype(std::nextafterl(0,0)), long double>::value), "");
static_assert((std::is_same<decltype(std::nextafter((int)0, (int)0)), double>::value), "");
- assert(std::nextafter(0,1) == 0x1p-1074);
+ assert(std::nextafter(0,1) == hexfloat<double>(0x1, 0, -1074));
}
void test_nexttoward()
@@ -1107,7 +1109,7 @@ void test_nexttoward()
static_assert((std::is_same<decltype(std::nexttoward((long double)0, (long double)0)), long double>::value), "");
static_assert((std::is_same<decltype(std::nexttowardf(0, (long double)0)), float>::value), "");
static_assert((std::is_same<decltype(std::nexttowardl(0, (long double)0)), long double>::value), "");
- assert(std::nexttoward(0, 1) == 0x1p-1074);
+ assert(std::nexttoward(0, 1) == hexfloat<double>(0x1, 0, -1074));
}
void test_remainder()
OpenPOWER on IntegriCloud