//===----------------------------------------------------------------------===// // // 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. // //===----------------------------------------------------------------------===// // test numeric_limits // epsilon() #include #include #include #include "test_macros.h" template void test(T expected) { assert(std::numeric_limits::epsilon() == expected); assert(std::numeric_limits::epsilon() == expected); assert(std::numeric_limits::epsilon() == expected); assert(std::numeric_limits::epsilon() == expected); } int main() { test(false); test(0); test(0); test(0); test(0); #if TEST_STD_VER > 17 && defined(__cpp_char8_t) test(0); #endif #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS test(0); test(0); #endif // _LIBCPP_HAS_NO_UNICODE_CHARS test(0); test(0); test(0); test(0); test(0); test(0); test(0); test(0); #ifndef _LIBCPP_HAS_NO_INT128 test<__int128_t>(0); test<__uint128_t>(0); #endif test(FLT_EPSILON); test(DBL_EPSILON); test(LDBL_EPSILON); }