1 // (C) Copyright John Maddock 2006.
2 // Use, modification and distribution are subject to the
3 // Boost Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #include "test_2F0.hpp"
8 #include <boost/multiprecision/cpp_bin_float.hpp>
9 #include <boost/multiprecision/cpp_dec_float.hpp>
11 void expected_results()
14 // Define the max and mean errors expected for
15 // various compilers and platforms.
17 const char* largest_type;
18 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
19 if(boost::math::policies::digits<double, boost::math::policies::policy<> >() == boost::math::policies::digits<long double, boost::math::policies::policy<> >())
21 largest_type = "(long\\s+)?double|real_concept|cpp_bin_float_quad|dec_40";
25 largest_type = "long double|real_concept|cpp_bin_float_quad|dec_40";
28 largest_type = "(long\\s+)?double|cpp_bin_float_quad|dec_40";
31 if (boost::math::policies::digits<double, boost::math::policies::policy<> >() != boost::math::policies::digits<long double, boost::math::policies::policy<> >())
37 "double", // test type(s)
38 "Random non-integer a2.*", // test data group
39 ".*", 10, 5); // test function
44 "double", // test type(s)
45 "a1 = a2 \\+ 0\\.5", // test data group
46 ".*", 10, 5); // test function
53 largest_type, // test type(s)
54 "Random non-integer a2.*", // test data group
55 ".*", 9000, 3000); // test function
60 largest_type, // test type(s)
61 "Integer.*", // test data group
62 ".*", 300, 100); // test function
67 largest_type, // test type(s)
68 "a1 = a2 \\+ 0\\.5", // test data group
69 ".*", 2000, 200); // test function
72 // Finish off by printing out the compiler/stdlib/platform names,
73 // we do this to make it easier to mark up expected error rates.
75 std::cout << "Tests run with " << BOOST_COMPILER << ", "
76 << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
79 BOOST_AUTO_TEST_CASE( test_main )
81 typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<40> > dec_40;
83 BOOST_MATH_CONTROL_FP;
85 #ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
86 test_spots(0.0F, "float");
88 test_spots(0.0, "double");
89 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
90 test_spots(0.0L, "long double");
91 #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS
92 test_spots(boost::math::concepts::real_concept(0.1), "real_concept");
95 test_spots(boost::multiprecision::cpp_bin_float_quad(), "cpp_bin_float_quad");
96 test_spots(dec_40(), "dec_40");