Opened 15 months ago

Closed 7 months 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:


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@…> 15 months ago.

Download all attachments as: .zip

Change History (3)

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

Attachment: mpfr.patch added

comment:1 Changed 7 months ago by John Maddock

Component: Nonemultiprecision
Owner: set to John Maddock

comment:2 Changed 7 months ago by John Maddock

Resolution: fixed
Status: newclosed

Good catch, fixed in develop.

Note: See TracTickets for help on using tickets.