mirror of
https://github.com/boostorg/multiprecision.git
synced 2026-01-19 04:22:11 +00:00
Merge branch 'develop' into cpp_double_fp_backend_integration
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
[template mpf_class[] [@http://gmplib.org/manual/C_002b_002b-Interface-Floats.html#C_002b_002b-Interface-Floats mpf_class]]
|
||||
[template mpfr_class[] [@http://math.berkeley.edu/~wilken/code/gmpfrxx/ mpfr_class]]
|
||||
[template mpreal[] [@http://www.holoborodko.com/pavel/mpfr/ mpreal]]
|
||||
[template mpir[] [@http://mpir.org/ MPIR]]
|
||||
[template mpir[] [@https://github.com/wbhart/mpir/ MPIR]]
|
||||
[template tommath[] [@http://libtom.net libtommath]]
|
||||
[template quadmath[] [@http://gcc.gnu.org/onlinedocs/libquadmath/ libquadmath]]
|
||||
|
||||
|
||||
@@ -2843,7 +2843,7 @@ template <class tag, class A1, class A2, class A3, class A4, class Policy>
|
||||
inline BOOST_MP_CXX14_CONSTEXPR typename detail::expression<tag, A1, A2, A3, A4>::result_type trunc(const detail::expression<tag, A1, A2, A3, A4>& v, const Policy& pol)
|
||||
{
|
||||
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
|
||||
return std::move(trunc(number_type(v), pol));
|
||||
return trunc(number_type(v), pol);
|
||||
}
|
||||
|
||||
template <class Backend, expression_template_option ExpressionTemplates, class Policy>
|
||||
@@ -2943,7 +2943,7 @@ template <class tag, class A1, class A2, class A3, class A4, class Policy>
|
||||
inline BOOST_MP_CXX14_CONSTEXPR typename detail::expression<tag, A1, A2, A3, A4>::result_type round(const detail::expression<tag, A1, A2, A3, A4>& v, const Policy& pol)
|
||||
{
|
||||
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
|
||||
return std::move(round(static_cast<number_type>(v), pol));
|
||||
return round(static_cast<number_type>(v), pol);
|
||||
}
|
||||
template <class T, expression_template_option ExpressionTemplates, class Policy>
|
||||
inline BOOST_MP_CXX14_CONSTEXPR number<T, ExpressionTemplates> round(const number<T, ExpressionTemplates>& v, const Policy&)
|
||||
@@ -3057,7 +3057,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<typename
|
||||
frexp(const detail::expression<tag, A1, A2, A3, A4>& v, short* pint)
|
||||
{
|
||||
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
|
||||
return std::move(frexp(static_cast<number_type>(v), pint));
|
||||
return frexp(static_cast<number_type>(v), pint);
|
||||
}
|
||||
template <class T, expression_template_option ExpressionTemplates>
|
||||
inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<T>::value == number_kind_floating_point, number<T, ExpressionTemplates> >::type frexp(const number<T, ExpressionTemplates>& v, int* pint)
|
||||
@@ -3073,7 +3073,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<typename
|
||||
frexp(const detail::expression<tag, A1, A2, A3, A4>& v, int* pint)
|
||||
{
|
||||
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
|
||||
return std::move(frexp(static_cast<number_type>(v), pint));
|
||||
return frexp(static_cast<number_type>(v), pint);
|
||||
}
|
||||
template <class T, expression_template_option ExpressionTemplates>
|
||||
inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<T>::value == number_kind_floating_point, number<T, ExpressionTemplates> >::type frexp(const number<T, ExpressionTemplates>& v, long* pint)
|
||||
@@ -3089,7 +3089,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<typename
|
||||
frexp(const detail::expression<tag, A1, A2, A3, A4>& v, long* pint)
|
||||
{
|
||||
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
|
||||
return std::move(frexp(static_cast<number_type>(v), pint));
|
||||
return frexp(static_cast<number_type>(v), pint);
|
||||
}
|
||||
template <class T, expression_template_option ExpressionTemplates>
|
||||
inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<T>::value == number_kind_floating_point, number<T, ExpressionTemplates> >::type frexp(const number<T, ExpressionTemplates>& v, long long* pint)
|
||||
@@ -3105,7 +3105,7 @@ inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<number_category<typename
|
||||
frexp(const detail::expression<tag, A1, A2, A3, A4>& v, long long* pint)
|
||||
{
|
||||
using number_type = typename detail::expression<tag, A1, A2, A3, A4>::result_type;
|
||||
return std::move(frexp(static_cast<number_type>(v), pint));
|
||||
return frexp(static_cast<number_type>(v), pint);
|
||||
}
|
||||
//
|
||||
// modf does not return an expression template since we require the
|
||||
|
||||
@@ -136,7 +136,7 @@ inline constexpr unsigned current_precision_of(const expression<tag, Arg1, Arg2,
|
||||
#endif
|
||||
|
||||
template <class R, bool = boost::multiprecision::detail::is_variable_precision<R>::value>
|
||||
struct scoped_default_precision
|
||||
struct BOOST_ATTRIBUTE_UNUSED scoped_default_precision
|
||||
{
|
||||
template <class T>
|
||||
constexpr scoped_default_precision(const T&) {}
|
||||
|
||||
@@ -2967,6 +2967,8 @@ inline boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<D
|
||||
boost::multiprecision::detail::scoped_default_precision<boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<Digits10, AllocateType>, ExpressionTemplates> > precision_guard(arg);
|
||||
|
||||
boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<Digits10, AllocateType>, ExpressionTemplates> result;
|
||||
if (arg < -1)
|
||||
return policies::raise_domain_error("log1p<%1%>(%1%)", "Argument was %1% but must be greater than -1", arg, pol);
|
||||
mpfr_log1p(result.backend().data(), arg.backend().data(), GMP_RNDN);
|
||||
if (mpfr_inf_p(result.backend().data()))
|
||||
return (arg == -1 ? -1 : 1) * policies::raise_overflow_error<boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<Digits10, AllocateType>, ExpressionTemplates> >("log1p<%1%>(%1%)", nullptr, pol);
|
||||
|
||||
Reference in New Issue
Block a user