Opened 5 years ago

Closed 4 years 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@…> 5 years ago.

Download all attachments as: .zip

Change History (3)

by Victor Sunye <victor.sunye@…>, 5 years ago

Attachment: mpfr.patch added

comment:1 by John Maddock, 4 years ago

Component: Nonemultiprecision
Owner: set to John Maddock

comment:2 by John Maddock, 4 years ago

Resolution: fixed
Status: newclosed

Good catch, fixed in develop.

Note: See TracTickets for help on using tickets.