diff DEPENDENCIES/generic/include/boost/multiprecision/mpfr.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/multiprecision/mpfr.hpp	Fri Sep 04 12:01:02 2015 +0100
+++ b/DEPENDENCIES/generic/include/boost/multiprecision/mpfr.hpp	Mon Sep 07 11:12:49 2015 +0100
@@ -144,11 +144,10 @@
    }
    mpfr_float_imp& operator = (long long i)
    {
-      BOOST_MP_USING_ABS
       if(m_data[0]._mpfr_d == 0)
          mpfr_init2(m_data, multiprecision::detail::digits10_2_2(digits10 ? digits10 : get_default_precision()));
       bool neg = i < 0;
-      *this = static_cast<unsigned long long>(abs(i));
+      *this = boost::multiprecision::detail::unsigned_abs(i);
       if(neg)
          mpfr_neg(m_data, m_data, GMP_RNDN);
       return *this;
@@ -427,9 +426,8 @@
    }
    mpfr_float_imp& operator = (long long i)
    {
-      BOOST_MP_USING_ABS
       bool neg = i < 0;
-      *this = static_cast<unsigned long long>(abs(i));
+      *this = boost::multiprecision::detail::unsigned_abs(i);
       if(neg)
          mpfr_neg(m_data, m_data, GMP_RNDN);
       return *this;
@@ -626,7 +624,7 @@
    mpfr_float_backend() : detail::mpfr_float_imp<digits10, AllocationType>() {}
    mpfr_float_backend(const mpfr_float_backend& o) : detail::mpfr_float_imp<digits10, AllocationType>(o) {}
 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-   mpfr_float_backend(mpfr_float_backend&& o) : detail::mpfr_float_imp<digits10, AllocationType>(static_cast<detail::mpfr_float_imp<digits10, AllocationType>&&>(o)) {}
+   mpfr_float_backend(mpfr_float_backend&& o) BOOST_NOEXCEPT : detail::mpfr_float_imp<digits10, AllocationType>(static_cast<detail::mpfr_float_imp<digits10, AllocationType>&&>(o)) {}
 #endif
    template <unsigned D, mpfr_allocation_type AT>
    mpfr_float_backend(const mpfr_float_backend<D, AT>& val, typename enable_if_c<D <= digits10>::type* = 0)
@@ -988,7 +986,7 @@
    if(i > 0)
       mpfr_add_ui(result.data(), result.data(), i, GMP_RNDN);
    else
-      mpfr_sub_ui(result.data(), result.data(), std::abs(i), GMP_RNDN);
+      mpfr_sub_ui(result.data(), result.data(), boost::multiprecision::detail::unsigned_abs(i), GMP_RNDN);
 }
 template <unsigned digits10, mpfr_allocation_type AllocationType>
 inline void eval_subtract(mpfr_float_backend<digits10, AllocationType>& result, long i)
@@ -996,19 +994,19 @@
    if(i > 0)
       mpfr_sub_ui(result.data(), result.data(), i, GMP_RNDN);
    else
-      mpfr_add_ui(result.data(), result.data(), std::abs(i), GMP_RNDN);
+      mpfr_add_ui(result.data(), result.data(), boost::multiprecision::detail::unsigned_abs(i), GMP_RNDN);
 }
 template <unsigned digits10, mpfr_allocation_type AllocationType>
 inline void eval_multiply(mpfr_float_backend<digits10, AllocationType>& result, long i)
 {
-   mpfr_mul_ui(result.data(), result.data(), std::abs(i), GMP_RNDN);
+   mpfr_mul_ui(result.data(), result.data(), boost::multiprecision::detail::unsigned_abs(i), GMP_RNDN);
    if(i < 0)
       mpfr_neg(result.data(), result.data(), GMP_RNDN);
 }
 template <unsigned digits10, mpfr_allocation_type AllocationType>
 inline void eval_divide(mpfr_float_backend<digits10, AllocationType>& result, long i)
 {
-   mpfr_div_ui(result.data(), result.data(), std::abs(i), GMP_RNDN);
+   mpfr_div_ui(result.data(), result.data(), boost::multiprecision::detail::unsigned_abs(i), GMP_RNDN);
    if(i < 0)
       mpfr_neg(result.data(), result.data(), GMP_RNDN);
 }
@@ -1029,7 +1027,7 @@
 inline void eval_add(mpfr_float_backend<D1, A1>& a, const mpfr_float_backend<D2, A2>& x, long y)
 {
    if(y < 0)
-      mpfr_sub_ui(a.data(), x.data(), -y, GMP_RNDN);
+      mpfr_sub_ui(a.data(), x.data(), boost::multiprecision::detail::unsigned_abs(y), GMP_RNDN);
    else
       mpfr_add_ui(a.data(), x.data(), y, GMP_RNDN);
 }
@@ -1043,7 +1041,7 @@
 {
    if(x < 0)
    {
-      mpfr_ui_sub(a.data(), -x, y.data(), GMP_RNDN);
+      mpfr_ui_sub(a.data(), boost::multiprecision::detail::unsigned_abs(x), y.data(), GMP_RNDN);
       mpfr_neg(a.data(), a.data(), GMP_RNDN);
    }
    else
@@ -1063,7 +1061,7 @@
 inline void eval_subtract(mpfr_float_backend<D1, A1>& a, const mpfr_float_backend<D2, A2>& x, long y)
 {
    if(y < 0)
-      mpfr_add_ui(a.data(), x.data(), -y, GMP_RNDN);
+      mpfr_add_ui(a.data(), x.data(), boost::multiprecision::detail::unsigned_abs(y), GMP_RNDN);
    else
       mpfr_sub_ui(a.data(), x.data(), y, GMP_RNDN);
 }
@@ -1077,7 +1075,7 @@
 {
    if(x < 0)
    {
-      mpfr_add_ui(a.data(), y.data(), -x, GMP_RNDN);
+      mpfr_add_ui(a.data(), y.data(), boost::multiprecision::detail::unsigned_abs(x), GMP_RNDN);
       mpfr_neg(a.data(), a.data(), GMP_RNDN);
    }
    else
@@ -1102,7 +1100,7 @@
 {
    if(y < 0)
    {
-      mpfr_mul_ui(a.data(), x.data(), -y, GMP_RNDN);
+      mpfr_mul_ui(a.data(), x.data(), boost::multiprecision::detail::unsigned_abs(y), GMP_RNDN);
       a.negate();
    }
    else
@@ -1118,7 +1116,7 @@
 {
    if(x < 0)
    {
-      mpfr_mul_ui(a.data(), y.data(), -x, GMP_RNDN);
+      mpfr_mul_ui(a.data(), y.data(), boost::multiprecision::detail::unsigned_abs(x), GMP_RNDN);
       mpfr_neg(a.data(), a.data(), GMP_RNDN);
    }
    else
@@ -1140,7 +1138,7 @@
 {
    if(y < 0)
    {
-      mpfr_div_ui(a.data(), x.data(), -y, GMP_RNDN);
+      mpfr_div_ui(a.data(), x.data(), boost::multiprecision::detail::unsigned_abs(y), GMP_RNDN);
       a.negate();
    }
    else
@@ -1156,7 +1154,7 @@
 {
    if(x < 0)
    {
-      mpfr_ui_div(a.data(), -x, y.data(), GMP_RNDN);
+      mpfr_ui_div(a.data(), boost::multiprecision::detail::unsigned_abs(x), y.data(), GMP_RNDN);
       mpfr_neg(a.data(), a.data(), GMP_RNDN);
    }
    else