// float_test.cpp --------------------------------------------------------------------// // Copyright Beman Dawes 2015 // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt // See library home page at http://www.boost.org/libs/endian //--------------------------------------------------------------------------------------// #include //#define BOOST_ENDIAN_LOG #include #include #include #include #include using namespace boost::endian; using std::cout; using std::endl; using std::numeric_limits; namespace { template void report_limits(const char* type) { cout << "\nHeader values for std::numeric_limits<" << type << ">\n\n"; cout << " is_specialized " << numeric_limits::is_specialized << "\n"; cout << " min() " << numeric_limits::min() << "\n"; cout << " max() " << numeric_limits::max() << "\n"; cout << " lowest() " << numeric_limits::lowest() << "\n"; cout << " digits " << numeric_limits::digits << "\n"; cout << " digits10 " << numeric_limits::digits10 << "\n"; cout << " max_digits10 " << numeric_limits::max_digits10 << "\n"; } } // unnamed namespace //--------------------------------------------------------------------------------------// int cpp_main(int, char *[]) { cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl; report_limits("float"); report_limits("double"); cout << "\n done" << endl; return ::boost::report_errors(); } #include