Add extra conversion function to mpfr_float_backend to prevent double-rounding in some corner cases.

This commit is contained in:
jzmaddock
2016-03-22 08:15:19 +00:00
parent 5f49ffc2d7
commit bd42232898

View File

@@ -1228,6 +1228,11 @@ inline void eval_convert_to(boost::long_long_type* result, const mpfr_float_back
}
#endif
template <unsigned digits10, mpfr_allocation_type AllocationType>
inline void eval_convert_to(float* result, const mpfr_float_backend<digits10, AllocationType>& val) BOOST_NOEXCEPT
{
*result = mpfr_get_flt(val.data(), GMP_RNDN);
}
template <unsigned digits10, mpfr_allocation_type AllocationType>
inline void eval_convert_to(double* result, const mpfr_float_backend<digits10, AllocationType>& val) BOOST_NOEXCEPT
{
*result = mpfr_get_d(val.data(), GMP_RNDN);