round_fwd.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // Copyright John Maddock 2008.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt
  5. // or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef BOOST_MATH_SPECIAL_ROUND_FWD_HPP
  7. #define BOOST_MATH_SPECIAL_ROUND_FWD_HPP
  8. #include <boost/config.hpp>
  9. #include <boost/math/tools/promotion.hpp>
  10. #ifdef _MSC_VER
  11. #pragma once
  12. #endif
  13. namespace boost
  14. {
  15. namespace math
  16. {
  17. template <class T, class Policy>
  18. typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol);
  19. template <class T>
  20. typename tools::promote_args<T>::type trunc(const T& v);
  21. template <class T, class Policy>
  22. int itrunc(const T& v, const Policy& pol);
  23. template <class T>
  24. int itrunc(const T& v);
  25. template <class T, class Policy>
  26. long ltrunc(const T& v, const Policy& pol);
  27. template <class T>
  28. long ltrunc(const T& v);
  29. #ifdef BOOST_HAS_LONG_LONG
  30. template <class T, class Policy>
  31. boost::long_long_type lltrunc(const T& v, const Policy& pol);
  32. template <class T>
  33. boost::long_long_type lltrunc(const T& v);
  34. #endif
  35. template <class T, class Policy>
  36. typename tools::promote_args<T>::type round(const T& v, const Policy& pol);
  37. template <class T>
  38. typename tools::promote_args<T>::type round(const T& v);
  39. template <class T, class Policy>
  40. int iround(const T& v, const Policy& pol);
  41. template <class T>
  42. int iround(const T& v);
  43. template <class T, class Policy>
  44. long lround(const T& v, const Policy& pol);
  45. template <class T>
  46. long lround(const T& v);
  47. #ifdef BOOST_HAS_LONG_LONG
  48. template <class T, class Policy>
  49. boost::long_long_type llround(const T& v, const Policy& pol);
  50. template <class T>
  51. boost::long_long_type llround(const T& v);
  52. #endif
  53. template <class T, class Policy>
  54. T modf(const T& v, T* ipart, const Policy& pol);
  55. template <class T>
  56. T modf(const T& v, T* ipart);
  57. template <class T, class Policy>
  58. T modf(const T& v, int* ipart, const Policy& pol);
  59. template <class T>
  60. T modf(const T& v, int* ipart);
  61. template <class T, class Policy>
  62. T modf(const T& v, long* ipart, const Policy& pol);
  63. template <class T>
  64. T modf(const T& v, long* ipart);
  65. #ifdef BOOST_HAS_LONG_LONG
  66. template <class T, class Policy>
  67. T modf(const T& v, boost::long_long_type* ipart, const Policy& pol);
  68. template <class T>
  69. T modf(const T& v, boost::long_long_type* ipart);
  70. #endif
  71. }
  72. }
  73. #undef BOOST_MATH_STD_USING
  74. #define BOOST_MATH_STD_USING BOOST_MATH_STD_USING_CORE\
  75. using boost::math::round;\
  76. using boost::math::iround;\
  77. using boost::math::lround;\
  78. using boost::math::trunc;\
  79. using boost::math::itrunc;\
  80. using boost::math::ltrunc;\
  81. using boost::math::modf;
  82. #endif // BOOST_MATH_SPECIAL_ROUND_FWD_HPP