]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/test/test_rationals.cpp
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 <boost/math/concepts/real_concept.hpp>
7 #define BOOST_TEST_MAIN
8 #include <boost/test/unit_test.hpp>
9 #include <boost/test/floating_point_comparison.hpp>
10 #include <boost/array.hpp>
11 #include <boost/math/tools/rational.hpp>
14 template <class T
, class U
>
15 void do_test_spots(T
, U
);
18 void test_spots(T t
, const char* n
)
20 std::cout
<< "Testing basic sanity checks for type " << n
<< std::endl
;
21 do_test_spots(t
, int(0));
22 do_test_spots(t
, unsigned(0));
23 #ifdef BOOST_HAS_LONG_LONG
24 do_test_spots(t
, (boost::ulong_long_type
)(0));
26 do_test_spots(t
, float(0));
27 do_test_spots(t
, T(0));
30 BOOST_AUTO_TEST_CASE( test_main
)
32 test_spots(0.0F
, "float");
33 test_spots(0.0, "double");
34 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
35 test_spots(0.0L, "long double");
36 #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS
37 test_spots(boost::math::concepts::real_concept(0.1), "real_concept");
40 std::cout
<< "<note>The long double tests have been disabled on this platform "
41 "either because the long double overloads of the usual math functions are "
42 "not available at all, or because they are too inaccurate for these tests "
43 "to pass.</note>" << std::endl
;