mirror of
https://github.com/boostorg/multiprecision.git
synced 2026-02-20 02:42:26 +00:00
Add extra conversion function to mpfr_float_backend to prevent double-rounding in some corner cases.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user