Opened 9 years ago
Closed 9 years ago
#8692 closed Bugs (fixed)
setting mpfr precision uses wrong precision and trashes value
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | multiprecision |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
http://svn.boost.org/svn/boost/trunk/boost/multiprecision/mpfr.hpp Two bugs in boost/multiprecision/mpfr.hpp:920-923
- set_prec trashes the value, should use prec_round
- precision is converted from bits to digits10, should be from digits10 to bits
void precision(unsigned digits10) BOOST_NOEXCEPT { mpfr_set_prec(this->m_data, multiprecision::detail::digits2_2_10((digits10))); }
should be more like
void precision(unsigned digits10) BOOST_NOEXCEPT { mpfr_prec_round(this->m_data, multiprecision::detail::digits10_2_2((digits10)), GMP_RNDN); }
Note:
See TracTickets
for help on using tickets.
(In [84763]) Apply patch from #8692. Refs #8692.