2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-26 04:42:22 +00:00

Revert "Update version history."

This reverts commit 430f0dc6e2.
This commit is contained in:
Matt Borland
2023-11-18 08:23:17 +01:00
parent 430f0dc6e2
commit fd0a0bf207
493 changed files with 3132 additions and 2466 deletions

View File

@@ -21,37 +21,37 @@ namespace boost
{
template <class T, class Policy>
constexpr typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol);
typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol);
template <class T>
constexpr typename tools::promote_args<T>::type trunc(const T& v);
typename tools::promote_args<T>::type trunc(const T& v);
template <class T, class Policy>
constexpr int itrunc(const T& v, const Policy& pol);
int itrunc(const T& v, const Policy& pol);
template <class T>
constexpr int itrunc(const T& v);
int itrunc(const T& v);
template <class T, class Policy>
constexpr long ltrunc(const T& v, const Policy& pol);
long ltrunc(const T& v, const Policy& pol);
template <class T>
constexpr long ltrunc(const T& v);
long ltrunc(const T& v);
template <class T, class Policy>
constexpr long long lltrunc(const T& v, const Policy& pol);
long long lltrunc(const T& v, const Policy& pol);
template <class T>
constexpr long long lltrunc(const T& v);
long long lltrunc(const T& v);
template <class T, class Policy>
constexpr typename tools::promote_args<T>::type round(const T& v, const Policy& pol);
typename tools::promote_args<T>::type round(const T& v, const Policy& pol);
template <class T>
constexpr typename tools::promote_args<T>::type round(const T& v);
typename tools::promote_args<T>::type round(const T& v);
template <class T, class Policy>
constexpr int iround(const T& v, const Policy& pol);
int iround(const T& v, const Policy& pol);
template <class T>
constexpr int iround(const T& v);
int iround(const T& v);
template <class T, class Policy>
constexpr long lround(const T& v, const Policy& pol);
long lround(const T& v, const Policy& pol);
template <class T>
constexpr long lround(const T& v);
long lround(const T& v);
template <class T, class Policy>
constexpr long long llround(const T& v, const Policy& pol);
long long llround(const T& v, const Policy& pol);
template <class T>
constexpr long long llround(const T& v);
long long llround(const T& v);
template <class T, class Policy>
T modf(const T& v, T* ipart, const Policy& pol);
template <class T>

View File

@@ -12,7 +12,7 @@
#endif
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/constexpr_workarounds.hpp>
#include <boost/math/ccmath/detail/config.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
@@ -30,12 +30,12 @@ namespace boost{ namespace math{
namespace detail{
template <class T, class Policy>
constexpr inline tools::promote_args_t<T> round(const T& v, const Policy& pol, const std::false_type&)
inline tools::promote_args_t<T> round(const T& v, const Policy& pol, const std::false_type&)
{
BOOST_MATH_STD_USING
using result_type = tools::promote_args_t<T>;
if(!BOOST_MATH_CONSTEXPR_ISFINITE(v))
if(!(boost::math::isfinite)(v))
{
return policies::raise_rounding_error("boost::math::round<%1%>(%1%)", nullptr, static_cast<result_type>(v), static_cast<result_type>(v), pol);
}
@@ -54,18 +54,18 @@ constexpr inline tools::promote_args_t<T> round(const T& v, const Policy& pol, c
{
// subtract v from ceil(v) first in order to avoid rounding
// errors on largest representable integer numbers
result_type c(BOOST_MATH_CONSTEXPR_CEIL(v));
result_type c(ceil(v));
return T(0.5) < c - v ? c - 1 : c;
}
else
{
// see former branch
result_type f(BOOST_MATH_CONSTEXPR_FLOOR(v));
result_type f(floor(v));
return T(0.5) < v - f ? f + 1 : f;
}
}
template <class T, class Policy>
constexpr inline tools::promote_args_t<T> round(const T& v, const Policy&, const std::true_type&)
inline tools::promote_args_t<T> round(const T& v, const Policy&, const std::true_type&)
{
return v;
}
@@ -73,12 +73,12 @@ constexpr inline tools::promote_args_t<T> round(const T& v, const Policy&, const
} // namespace detail
template <class T, class Policy>
constexpr inline tools::promote_args_t<T> round(const T& v, const Policy& pol)
inline tools::promote_args_t<T> round(const T& v, const Policy& pol)
{
return detail::round(v, pol, std::integral_constant<bool, detail::is_integer_for_rounding<T>::value>());
}
template <class T>
constexpr inline tools::promote_args_t<T> round(const T& v)
inline tools::promote_args_t<T> round(const T& v)
{
return round(v, policies::policy<>());
}
@@ -96,7 +96,7 @@ constexpr inline tools::promote_args_t<T> round(const T& v)
// https://stackoverflow.com/questions/27442885/syntax-error-with-stdnumeric-limitsmax
//
template <class T, class Policy>
constexpr inline int iround(const T& v, const Policy& pol)
inline int iround(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
using result_type = tools::promote_args_t<T>;
@@ -138,13 +138,13 @@ constexpr inline int iround(const T& v, const Policy& pol)
return static_cast<int>(r);
}
template <class T>
constexpr inline int iround(const T& v)
inline int iround(const T& v)
{
return iround(v, policies::policy<>());
}
template <class T, class Policy>
constexpr inline long lround(const T& v, const Policy& pol)
inline long lround(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
using result_type = tools::promote_args_t<T>;
@@ -186,13 +186,13 @@ constexpr inline long lround(const T& v, const Policy& pol)
return static_cast<long>(r);
}
template <class T>
constexpr inline long lround(const T& v)
inline long lround(const T& v)
{
return lround(v, policies::policy<>());
}
template <class T, class Policy>
constexpr inline long long llround(const T& v, const Policy& pol)
inline long long llround(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
using result_type = boost::math::tools::promote_args_t<T>;
@@ -234,7 +234,7 @@ constexpr inline long long llround(const T& v, const Policy& pol)
return static_cast<long long>(r);
}
template <class T>
constexpr inline long long llround(const T& v)
inline long long llround(const T& v)
{
return llround(v, policies::policy<>());
}

View File

@@ -14,7 +14,7 @@
#include <type_traits>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/tools/config.hpp>
#include <boost/math/tools/constexpr_workarounds.hpp>
#include <boost/math/ccmath/detail/config.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/tools/is_constant_evaluated.hpp>
@@ -27,19 +27,19 @@
namespace boost{ namespace math{ namespace detail{
template <class T, class Policy>
constexpr inline tools::promote_args_t<T> trunc(const T& v, const Policy& pol, const std::false_type&)
inline tools::promote_args_t<T> trunc(const T& v, const Policy& pol, const std::false_type&)
{
BOOST_MATH_STD_USING
using result_type = tools::promote_args_t<T>;
if(!BOOST_MATH_CONSTEXPR_ISFINITE(v))
if(!(boost::math::isfinite)(v))
{
return policies::raise_rounding_error("boost::math::trunc<%1%>(%1%)", nullptr, static_cast<result_type>(v), static_cast<result_type>(v), pol);
}
return (v >= 0) ? static_cast<result_type>(BOOST_MATH_CONSTEXPR_FLOOR(v)) : static_cast<result_type>(BOOST_MATH_CONSTEXPR_CEIL(v));
return (v >= 0) ? static_cast<result_type>(floor(v)) : static_cast<result_type>(ceil(v));
}
template <class T, class Policy>
constexpr inline tools::promote_args_t<T> trunc(const T& v, const Policy&, const std::true_type&)
inline tools::promote_args_t<T> trunc(const T& v, const Policy&, const std::true_type&)
{
return v;
}
@@ -47,12 +47,12 @@ constexpr inline tools::promote_args_t<T> trunc(const T& v, const Policy&, const
}
template <class T, class Policy>
constexpr inline tools::promote_args_t<T> trunc(const T& v, const Policy& pol)
inline tools::promote_args_t<T> trunc(const T& v, const Policy& pol)
{
return detail::trunc(v, pol, std::integral_constant<bool, detail::is_integer_for_rounding<T>::value>());
}
template <class T>
constexpr inline tools::promote_args_t<T> trunc(const T& v)
inline tools::promote_args_t<T> trunc(const T& v)
{
return trunc(v, policies::policy<>());
}
@@ -70,7 +70,7 @@ constexpr inline tools::promote_args_t<T> trunc(const T& v)
// https://stackoverflow.com/questions/27442885/syntax-error-with-stdnumeric-limitsmax
//
template <class T, class Policy>
constexpr inline int itrunc(const T& v, const Policy& pol)
inline int itrunc(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
using result_type = tools::promote_args_t<T>;
@@ -111,13 +111,13 @@ constexpr inline int itrunc(const T& v, const Policy& pol)
return static_cast<int>(r);
}
template <class T>
constexpr inline int itrunc(const T& v)
inline int itrunc(const T& v)
{
return itrunc(v, policies::policy<>());
}
template <class T, class Policy>
constexpr inline long ltrunc(const T& v, const Policy& pol)
inline long ltrunc(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
using result_type = tools::promote_args_t<T>;
@@ -158,13 +158,13 @@ constexpr inline long ltrunc(const T& v, const Policy& pol)
return static_cast<long>(r);
}
template <class T>
constexpr inline long ltrunc(const T& v)
inline long ltrunc(const T& v)
{
return ltrunc(v, policies::policy<>());
}
template <class T, class Policy>
constexpr inline long long lltrunc(const T& v, const Policy& pol)
inline long long lltrunc(const T& v, const Policy& pol)
{
BOOST_MATH_STD_USING
using result_type = tools::promote_args_t<T>;
@@ -205,20 +205,20 @@ constexpr inline long long lltrunc(const T& v, const Policy& pol)
return static_cast<long long>(r);
}
template <class T>
constexpr inline long long lltrunc(const T& v)
inline long long lltrunc(const T& v)
{
return lltrunc(v, policies::policy<>());
}
template <class T, class Policy>
constexpr inline typename std::enable_if<std::is_constructible<int, T>::value, int>::type
inline typename std::enable_if<std::is_constructible<int, T>::value, int>::type
iconvert(const T& v, const Policy&)
{
return static_cast<int>(v);
}
template <class T, class Policy>
constexpr inline typename std::enable_if<!std::is_constructible<int, T>::value, int>::type
inline typename std::enable_if<!std::is_constructible<int, T>::value, int>::type
iconvert(const T& v, const Policy& pol)
{
using boost::math::itrunc;
@@ -226,14 +226,14 @@ constexpr inline typename std::enable_if<!std::is_constructible<int, T>::value,
}
template <class T, class Policy>
constexpr inline typename std::enable_if<std::is_constructible<long, T>::value, long>::type
inline typename std::enable_if<std::is_constructible<long, T>::value, long>::type
lconvert(const T& v, const Policy&)
{
return static_cast<long>(v);
}
template <class T, class Policy>
constexpr inline typename std::enable_if<!std::is_constructible<long, T>::value, long>::type
inline typename std::enable_if<!std::is_constructible<long, T>::value, long>::type
lconvert(const T& v, const Policy& pol)
{
using boost::math::ltrunc;
@@ -241,14 +241,14 @@ constexpr inline typename std::enable_if<!std::is_constructible<long, T>::value,
}
template <class T, class Policy>
constexpr inline typename std::enable_if<std::is_constructible<long long, T>::value, long long>::type
inline typename std::enable_if<std::is_constructible<long long, T>::value, long long>::type
llconvertert(const T& v, const Policy&)
{
return static_cast<long long>(v);
}
template <class T, class Policy>
constexpr inline typename std::enable_if<!std::is_constructible<long long, T>::value, long long>::type
inline typename std::enable_if<!std::is_constructible<long long, T>::value, long long>::type
llconvertert(const T& v, const Policy& pol)
{
using boost::math::lltrunc;