diff --git a/include/cmath b/include/cmath index ae507775..f8bc0dfc 100644 --- a/include/cmath +++ b/include/cmath @@ -303,8 +303,340 @@ long double truncl(long double x); #pragma GCC system_header +// signbit + +#ifdef signbit + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_signbit(_A1 __x) +{ + return signbit(__x); +} + +#undef signbit + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if::value, bool>::type +signbit(_A1 __x) +{ + return __libcpp_signbit(__x); +} + +#endif // signbit + +// fpclassify + +#ifdef fpclassify + +template +_LIBCPP_ALWAYS_INLINE +int +__libcpp_fpclassify(_A1 __x) +{ + return fpclassify(__x); +} + +#undef fpclassify + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if::value, int>::type +fpclassify(_A1 __x) +{ + return __libcpp_fpclassify(__x); +} + +#endif // fpclassify + +// isfinite + +#ifdef isfinite + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_isfinite(_A1 __x) +{ + return isfinite(__x); +} + +#undef isfinite + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if::value, bool>::type +isfinite(_A1 __x) +{ + return __libcpp_isfinite(__x); +} + +#endif // isfinite + +// isinf + +#ifdef isinf + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_isinf(_A1 __x) +{ + return isinf(__x); +} + +#undef isinf + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if::value, bool>::type +isinf(_A1 __x) +{ + return __libcpp_isinf(__x); +} + +#endif // isinf + +// isnan + +#ifdef isnan + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_isnan(_A1 __x) +{ + return isnan(__x); +} + +#undef isnan + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if::value, bool>::type +isnan(_A1 __x) +{ + return __libcpp_isnan(__x); +} + +#endif // isnan + +// isnormal + +#ifdef isnormal + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_isnormal(_A1 __x) +{ + return isnormal(__x); +} + +#undef isnormal + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if::value, bool>::type +isnormal(_A1 __x) +{ + return __libcpp_isnormal(__x); +} + +#endif // isnormal + +// isgreater + +#ifdef isgreater + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_isgreater(_A1 __x, _A2 __y) +{ + return isgreater(__x, __y); +} + +#undef isgreater + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if +< + std::is_floating_point<_A1>::value && + std::is_floating_point<_A2>::value, + bool +>::type +isgreater(_A1 __x, _A2 __y) +{ + return __libcpp_isgreater(__x, __y); +} + +#endif // isgreater + +// isgreaterequal + +#ifdef isgreaterequal + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_isgreaterequal(_A1 __x, _A2 __y) +{ + return isgreaterequal(__x, __y); +} + +#undef isgreaterequal + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if +< + std::is_floating_point<_A1>::value && + std::is_floating_point<_A2>::value, + bool +>::type +isgreaterequal(_A1 __x, _A2 __y) +{ + return __libcpp_isgreaterequal(__x, __y); +} + +#endif // isgreaterequal + +// isless + +#ifdef isless + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_isless(_A1 __x, _A2 __y) +{ + return isless(__x, __y); +} + +#undef isless + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if +< + std::is_floating_point<_A1>::value && + std::is_floating_point<_A2>::value, + bool +>::type +isless(_A1 __x, _A2 __y) +{ + return __libcpp_isless(__x, __y); +} + +#endif // isless + +// islessequal + +#ifdef islessequal + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_islessequal(_A1 __x, _A2 __y) +{ + return islessequal(__x, __y); +} + +#undef islessequal + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if +< + std::is_floating_point<_A1>::value && + std::is_floating_point<_A2>::value, + bool +>::type +islessequal(_A1 __x, _A2 __y) +{ + return __libcpp_islessequal(__x, __y); +} + +#endif // islessequal + +// islessgreater + +#ifdef islessgreater + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_islessgreater(_A1 __x, _A2 __y) +{ + return islessgreater(__x, __y); +} + +#undef islessgreater + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if +< + std::is_floating_point<_A1>::value && + std::is_floating_point<_A2>::value, + bool +>::type +islessgreater(_A1 __x, _A2 __y) +{ + return __libcpp_islessgreater(__x, __y); +} + +#endif // islessgreater + +// isunordered + +#ifdef isunordered + +template +_LIBCPP_ALWAYS_INLINE +bool +__libcpp_isunordered(_A1 __x, _A2 __y) +{ + return isunordered(__x, __y); +} + +#undef isunordered + +template +inline _LIBCPP_INLINE_VISIBILITY +typename std::enable_if +< + std::is_floating_point<_A1>::value && + std::is_floating_point<_A2>::value, + bool +>::type +isunordered(_A1 __x, _A2 __y) +{ + return __libcpp_isunordered(__x, __y); +} + +#endif // isunordered + _LIBCPP_BEGIN_NAMESPACE_STD +using ::signbit; +using ::fpclassify; +using ::isfinite; +using ::isinf; +using ::isnan; +using ::isnormal; +using ::isgreater; +using ::isgreaterequal; +using ::isless; +using ::islessequal; +using ::islessgreater; +using ::isunordered; +using ::isunordered; + using ::float_t; using ::double_t; @@ -629,348 +961,6 @@ inline _LIBCPP_INLINE_VISIBILITY typename enable_if::value, double>::type tanh(_A1 __x) {return tanh((double)__x);} -// signbit - -#ifndef signbit -#error Implementation error: signbit not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_signbit(_A1 __x) -{ - return signbit(__x); -} - -#undef signbit - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, bool>::type -signbit(_A1 __x) -{ - return __libcpp_signbit(__x); -} - -#endif // signbit - -// fpclassify - -#ifndef fpclassify -#error Implementation error: fpclassify not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -int -__libcpp_fpclassify(_A1 __x) -{ - return fpclassify(__x); -} - -#undef fpclassify - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, int>::type -fpclassify(_A1 __x) -{ - return __libcpp_fpclassify(__x); -} - -#endif // fpclassify - -// isfinite - -#ifndef isfinite -#error Implementation error: isfinite not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isfinite(_A1 __x) -{ - return isfinite(__x); -} - -#undef isfinite - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, bool>::type -isfinite(_A1 __x) -{ - return __libcpp_isfinite(__x); -} - -#endif // isfinite - -// isinf - -#ifndef isinf -#error Implementation error: isinf not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isinf(_A1 __x) -{ - return isinf(__x); -} - -#undef isinf - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, bool>::type -isinf(_A1 __x) -{ - return __libcpp_isinf(__x); -} - -#endif // isinf - -// isnan - -#ifndef isnan -#error Implementation error: isnan not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isnan(_A1 __x) -{ - return isnan(__x); -} - -#undef isnan - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, bool>::type -isnan(_A1 __x) -{ - return __libcpp_isnan(__x); -} - -#endif // isnan - -// isnormal - -#ifndef isnormal -#error Implementation error: isnormal not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isnormal(_A1 __x) -{ - return isnormal(__x); -} - -#undef isnormal - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, bool>::type -isnormal(_A1 __x) -{ - return __libcpp_isnormal(__x); -} - -#endif // isnormal - -// isgreater - -#ifndef isgreater -#error Implementation error: isgreater not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isgreater(_A1 __x, _A2 __y) -{ - return isgreater(__x, __y); -} - -#undef isgreater - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_floating_point<_A1>::value && - is_floating_point<_A2>::value, - bool ->::type -isgreater(_A1 __x, _A2 __y) -{ - return __libcpp_isgreater(__x, __y); -} - -#endif // isgreater - -// isgreaterequal - -#ifndef isgreaterequal -#error Implementation error: isgreaterequal not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isgreaterequal(_A1 __x, _A2 __y) -{ - return isgreaterequal(__x, __y); -} - -#undef isgreaterequal - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_floating_point<_A1>::value && - is_floating_point<_A2>::value, - bool ->::type -isgreaterequal(_A1 __x, _A2 __y) -{ - return __libcpp_isgreaterequal(__x, __y); -} - -#endif // isgreaterequal - -// isless - -#ifndef isless -#error Implementation error: isless not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isless(_A1 __x, _A2 __y) -{ - return isless(__x, __y); -} - -#undef isless - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_floating_point<_A1>::value && - is_floating_point<_A2>::value, - bool ->::type -isless(_A1 __x, _A2 __y) -{ - return __libcpp_isless(__x, __y); -} - -#endif // isless - -// islessequal - -#ifndef islessequal -#error Implementation error: islessequal not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_islessequal(_A1 __x, _A2 __y) -{ - return islessequal(__x, __y); -} - -#undef islessequal - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_floating_point<_A1>::value && - is_floating_point<_A2>::value, - bool ->::type -islessequal(_A1 __x, _A2 __y) -{ - return __libcpp_islessequal(__x, __y); -} - -#endif // islessequal - -// islessgreater - -#ifndef islessgreater -#error Implementation error: islessgreater not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_islessgreater(_A1 __x, _A2 __y) -{ - return islessgreater(__x, __y); -} - -#undef islessgreater - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_floating_point<_A1>::value && - is_floating_point<_A2>::value, - bool ->::type -islessgreater(_A1 __x, _A2 __y) -{ - return __libcpp_islessgreater(__x, __y); -} - -#endif // islessgreater - -// isunordered - -#ifndef isunordered -#error Implementation error: isunordered not defined -#else - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isunordered(_A1 __x, _A2 __y) -{ - return isunordered(__x, __y); -} - -#undef isunordered - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if -< - is_floating_point<_A1>::value && - is_floating_point<_A2>::value, - bool ->::type -isunordered(_A1 __x, _A2 __y) -{ - return __libcpp_isunordered(__x, __y); -} - -#endif // isunordered - // acosh using ::acosh; diff --git a/include/iosfwd b/include/iosfwd index 0e5c683a..852d9e5f 100644 --- a/include/iosfwd +++ b/include/iosfwd @@ -20,6 +20,7 @@ namespace std template struct char_traits; template class allocator; +class ios_base; template > class basic_ios; template > class basic_streambuf; diff --git a/test/depr/depr.c.headers/math_h.pass.cpp b/test/depr/depr.c.headers/math_h.pass.cpp index 3ba34196..9bc3116e 100644 --- a/test/depr/depr.c.headers/math_h.pass.cpp +++ b/test/depr/depr.c.headers/math_h.pass.cpp @@ -13,6 +13,8 @@ #include #include +#include "../../hexfloat.h" + void test_acos() { static_assert((std::is_same::value), ""); @@ -194,9 +196,9 @@ void test_tanh() void test_signbit() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(signbit(-1.0) == true); } @@ -210,117 +212,117 @@ void test_fpclassify() void test_isfinite() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isfinite(-1.0) == true); } void test_isinf() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isinf(-1.0) == false); } void test_isnan() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isnan(-1.0) == false); } void test_isnormal() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isnormal(-1.0) == true); } void test_isgreater() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isgreater(-1.0, 0.F) == false); } void test_isgreaterequal() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isgreaterequal(-1.0, 0.F) == false); } void test_isless() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isless(-1.0, 0.F) == true); } void test_islessequal() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(islessequal(-1.0, 0.F) == true); } void test_islessgreater() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(islessgreater(-1.0, 0.F) == true); } void test_isunordered() { - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isunordered(-1.0, 0.F) == false); } @@ -528,7 +530,7 @@ void test_nextafter() static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - assert(nextafter(0,1) == 0x1p-1074); + assert(nextafter(0,1) == hexfloat(0x1, 0, -1074)); } void test_nexttoward() @@ -536,7 +538,7 @@ void test_nexttoward() static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - assert(nexttoward(0, 1) == 0x1p-1074); + assert(nexttoward(0, 1) == hexfloat(0x1, 0, -1074)); } void test_remainder() diff --git a/test/depr/depr.c.headers/stdio_h.pass.cpp b/test/depr/depr.c.headers/stdio_h.pass.cpp index 850200d7..50e1c80d 100644 --- a/test/depr/depr.c.headers/stdio_h.pass.cpp +++ b/test/depr/depr.c.headers/stdio_h.pass.cpp @@ -95,19 +95,19 @@ int main() static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); diff --git a/test/hexfloat.h b/test/hexfloat.h new file mode 100644 index 00000000..907de02c --- /dev/null +++ b/test/hexfloat.h @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// Define a hexfloat literal emulator since we can't depend on being able to +// for hexfloat literals + +// 0x10.F5p-10 == hexfloat(0x10, 0xF5, -10) + +#ifndef HEXFLOAT_H +#define HEXFLOAT_H + +#include +#include +#include + +template +class hexfloat +{ + T value_; +public: + hexfloat(unsigned long long m1, unsigned long long m0, int exp) + { + const std::size_t n = sizeof(unsigned long long) * CHAR_BIT; + value_ = std::ldexp(m1 + std::ldexp(T(m0), -static_cast(n - + std::__clz(m0))), exp); + } + + operator T() const {return value_;} +}; + +#endif diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp index cf30ea34..4fa9b0a8 100644 --- a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp +++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp @@ -20,6 +20,7 @@ #include #include #include "iterators.h" +#include "../../../../../hexfloat.h" typedef std::num_get > F; @@ -105,7 +106,7 @@ int main() ios, err, v); assert(iter.base() == str+sizeof(str)-1); assert(err == ios.goodbit); - assert(v == 0x125p-1); + assert(v == hexfloat(0x125, 0, -1)); } { const char str[] = "inf"; diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp index 00f9400e..c61dcdaf 100644 --- a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp +++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp @@ -20,6 +20,7 @@ #include #include #include "iterators.h" +#include "../../../../../hexfloat.h" typedef std::num_get > F; @@ -93,7 +94,7 @@ int main() ios, err, v); assert(iter.base() == str+sizeof(str)-1); assert(err == ios.goodbit); - assert(v == 0x125p-1); + assert(v == hexfloat(0x125, 0, -1)); } { const char str[] = "inf"; diff --git a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp index 89019fe2..d39ba0ac 100644 --- a/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp +++ b/test/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp @@ -20,6 +20,7 @@ #include #include #include "iterators.h" +#include "../../../../../hexfloat.h" typedef std::num_get > F; @@ -93,7 +94,7 @@ int main() ios, err, v); assert(iter.base() == str+sizeof(str)-1); assert(err == ios.goodbit); - assert(v == 0x125p-1); + assert(v == hexfloat(0x125, 0, -1)); } { const char str[] = "inf"; diff --git a/test/numerics/c.math/cmath.pass.cpp b/test/numerics/c.math/cmath.pass.cpp index 84d695e2..7fa763b6 100644 --- a/test/numerics/c.math/cmath.pass.cpp +++ b/test/numerics/c.math/cmath.pass.cpp @@ -13,6 +13,8 @@ #include #include +#include "../../hexfloat.h" + void test_abs() { static_assert((std::is_same::value), ""); @@ -1089,7 +1091,7 @@ void test_nextafter() static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - assert(std::nextafter(0,1) == 0x1p-1074); + assert(std::nextafter(0,1) == hexfloat(0x1, 0, -1074)); } void test_nexttoward() @@ -1107,7 +1109,7 @@ void test_nexttoward() static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - assert(std::nexttoward(0, 1) == 0x1p-1074); + assert(std::nexttoward(0, 1) == hexfloat(0x1, 0, -1074)); } void test_remainder()