6 changes: 2 additions & 4 deletions include/boost/multiprecision/mpfr.hpp
Expand Up @@ -144,11 +144,10 @@ struct mpfr_float_imp<digits10, allocate_dynamic>
}
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;
Expand Down Expand Up @@ -427,9 +426,8 @@ struct mpfr_float_imp<digits10, allocate_stack>
}
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;
Expand Down
3 changes: 1 addition & 2 deletions include/boost/multiprecision/tommath.hpp
Expand Up @@ -93,11 +93,10 @@ struct tommath_int
}
tommath_int& operator = (long long i)
{
BOOST_MP_USING_ABS
if(m_data.dp == 0)
detail::check_tommath_result(mp_init(&m_data));
bool neg = i < 0;
*this = static_cast<unsigned long long>(abs(i));
*this = boost::multiprecision::detail::unsigned_abs(i);
if(neg)
detail::check_tommath_result(mp_neg(&m_data, &m_data));
return *this;
Expand Down
2 changes: 2 additions & 0 deletions test/Jamfile.v2
Expand Up @@ -20,11 +20,13 @@ project : requirements
<include>$(mpfi_path)
<include>$(mpfi_path)/src
<include>$(tommath_path)
<include>../include
<include>../../..
# We set these to make it easier to set up and test GMP and MPFR under Win32:
<toolset>msvc:<runtime-link>static
<toolset>msvc:<link>static
<toolset>msvc:<warnings>all
<toolset>msvc:<cxxflags>/fp:precise
<toolset>intel-win:<runtime-link>static
<toolset>intel-win:<link>static
# Speed up compiles:
Expand Down