Modify

Ticket #8692 (closed Bugs: fixed)

Opened 10 months ago

Last modified 10 months ago

setting mpfr precision uses wrong precision and trashes value

Reported by: claude@… Owned by: johnmaddock
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

  1. set_prec trashes the value, should use prec_round
  2. 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);
}

Attachments

Change History

comment:1 Changed 10 months ago by johnmaddock

(In [84763]) Apply patch from #8692. Refs #8692.

comment:2 Changed 10 months ago by johnmaddock

  • Status changed from new to closed
  • Resolution set to fixed

(In [84799]) Merge fixes for from Trunk. Fixes #8692. Fixes #8670. Fixes #8667.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.