sf_modf_incl_test.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // 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)
  5. //
  6. // Basic sanity check that header <boost/math/special_functions/modf.hpp>
  7. // #includes all the files that it needs to.
  8. //
  9. #include <boost/math/special_functions/modf.hpp>
  10. //
  11. // Note this header includes no other headers, this is
  12. // important if this test is to be meaningful:
  13. //
  14. #include "test_compile_result.hpp"
  15. float ff;
  16. double dd;
  17. long double lldd;
  18. int ii;
  19. long ll;
  20. #ifdef BOOST_HAS_LONG_LONG
  21. boost::long_long_type llll;
  22. #endif
  23. void compile_and_link_test()
  24. {
  25. check_result<float>(boost::math::modf(f, &ff));
  26. check_result<double>(boost::math::modf(d, &dd));
  27. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  28. check_result<long double>(boost::math::modf(l, &lldd));
  29. #endif
  30. check_result<float>(boost::math::modf(f, &ii));
  31. check_result<double>(boost::math::modf(d, &ii));
  32. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  33. check_result<long double>(boost::math::modf(l, &ii));
  34. #endif
  35. check_result<float>(boost::math::modf(f, &ll));
  36. check_result<double>(boost::math::modf(d, &ll));
  37. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  38. check_result<long double>(boost::math::modf(l, &ll));
  39. #endif
  40. #ifdef BOOST_HAS_LONG_LONG
  41. check_result<float>(boost::math::modf(f, &llll));
  42. check_result<double>(boost::math::modf(d, &llll));
  43. #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
  44. check_result<long double>(boost::math::modf(l, &llll));
  45. #endif
  46. #endif
  47. }