1 // Copyright John Maddock 2006-15. 2 // Copyright Paul A. Bristow 2007 3 // Use, modification and distribution are subject to the 4 // Boost Software License, Version 1.0. (See accompanying file 5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 7 #include "bindings.hpp" 8 #include "../../test/test_igamma.hpp" 9 #include <boost/math/special_functions/gamma.hpp> 10 BOOST_AUTO_TEST_CASE(test_main)11BOOST_AUTO_TEST_CASE(test_main) 12 { 13 BOOST_MATH_CONTROL_FP; 14 15 error_stream_replacer rep; 16 17 #ifdef TYPE_TO_TEST 18 19 test_gamma(static_cast<TYPE_TO_TEST>(0), NAME_OF_TYPE_TO_TEST); 20 21 #else 22 bool test_float = false; 23 bool test_double = false; 24 bool test_long_double = false; 25 26 if(std::numeric_limits<long double>::digits == std::numeric_limits<double>::digits) 27 { 28 // 29 // Don't bother with long double, it's the same as double: 30 // 31 if(BOOST_MATH_PROMOTE_FLOAT_POLICY == false) 32 test_float = true; 33 test_double = true; 34 } 35 else 36 { 37 if(BOOST_MATH_PROMOTE_FLOAT_POLICY == false) 38 test_float = true; 39 if(BOOST_MATH_PROMOTE_DOUBLE_POLICY == false) 40 test_double = true; 41 test_long_double = true; 42 } 43 44 #ifdef ALWAYS_TEST_DOUBLE 45 test_double = true; 46 #endif 47 48 if(test_float) 49 test_gamma(0.0f, "float"); 50 if(test_double) 51 test_gamma(0.0, "double"); 52 if(test_long_double) 53 test_gamma(0.0L, "long double"); 54 #ifdef BOOST_MATH_USE_FLOAT128 55 //test_gamma(0.0Q, "__float128"); 56 #endif 57 58 59 #endif 60 } 61 62