id summary reporter owner description type status milestone component version severity resolution keywords cc 10085 Improve cpp_rational::convert_to marc.glisse@… John Maddock "Hello, the following program prints -nan. If I convert to long double, it prints 1 as expected, but the same problem happens for slightly bigger numerators and denominators. Worse, I can make it return inf or 0 for numbers close to 10 or 0.1. Instead of converting numerator and denominator to double and dividing, it would work better if you had some kind of frexp function that you could apply to both, so the exponents could cancel out without overflowing (that might actually be the same as converting to a cpp_float<53> if it existed). By the way, it would be nice to document what rounding we can expect from the conversion to double. For cpp_int, can I assume the result is within 1 ulp, rounded towards 0? .5 ulp, rounded to nearest? My goal is to get an interval of double that contains the number (convert_to> basically, except that I don't use boost's type for intervals). {{{#!c++ #include #include #include typedef boost::multiprecision::cpp_rational NT; int main(){ NT x (std::numeric_limits::min()); x *= x; x += 1; std::cout << x.convert_to() << '\n'; } }}} PS: thank you for the quick resolution to the previous ticket!" Feature Requests closed To Be Determined multiprecision Boost 1.55.0 Problem fixed