// (C) Copyright John Maddock 2025. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include #define BOOST_TEST_MAIN #include #include #include template void test() { // // Really just test our error handling: // BOOST_MATH_IF_CONSTEXPR(std::numeric_limits::has_quiet_NaN) { BOOST_CHECK_THROW(boost::math::ulp(std::numeric_limits::quiet_NaN()), std::domain_error); } BOOST_MATH_IF_CONSTEXPR(std::numeric_limits::has_infinity) { BOOST_CHECK_THROW(boost::math::ulp(std::numeric_limits::infinity()), std::overflow_error); } BOOST_CHECK_THROW(boost::math::ulp(boost::math::tools::max_value()), std::overflow_error); BOOST_CHECK(boost::math::ulp(static_cast(0)) != 0); } BOOST_AUTO_TEST_CASE( test_main ) { test(); test(); #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS test(); #endif test(); }