Modify

Opened 9 months ago

Closed 5 weeks ago

#13229 closed Bugs (fixed)

Infinite loop when printing certain values of type boost::multiprecision::mpfr_float.

Reported by: Victor Sunye <victor.sunye@…> Owned by: John Maddock
Milestone: To Be Determined Component: multiprecision
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description

The program below never terminates. The attached patch seems to solve the issue.

#include <boost/multiprecision/mpfr.hpp> #include <iostream>

int main (void) {

using mpfloat = boost::multiprecision::mpfr_float; mpfloat::default_precision (15); mpfloat x = 0.051;

std::cout.precision (1); std::cout << std::fixed << x << std::endl; return 0;

}

Attachments (1)

mpfr.patch (497 bytes) - added by Victor Sunye <victor.sunye@…> 9 months ago.

Download all attachments as: .zip

Change History (3)

Changed 9 months ago by Victor Sunye <victor.sunye@…>

Attachment: mpfr.patch added

comment:1 Changed 6 weeks ago by John Maddock

Component: Nonemultiprecision
Owner: set to John Maddock

comment:2 Changed 5 weeks ago by John Maddock

Resolution: fixed
Status: newclosed

Good catch, fixed in develop.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain John Maddock.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.