id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 9579,conversion error from boost cpp_rational to int,W Randolph Franklin ,John Maddock,"boost cpp_rational seems to convert wrong to int when the numerator and denominator have many digits. {{{ #include #include using namespace boost::multiprecision; using namespace std; int main() { cpp_rational a(""4561231231235/123123123123""); std::cout << ""bad convert: "" << a << ' ' << float(a) << ' ' << int(a) << ' ' << a.convert_to() << endl; a = (cpp_rational)""456/123""; std::cout << ""good convert: "" << a << ' ' << float(a) << ' ' << int(a) << ' ' << a.convert_to() << endl; } }}} The output is: {{{ bad convert: 651604461605/17589017589 37.0461 -3 -3 good convert: 152/41 3.70732 3 3 }}} Also, attempts to convert cpp_rational to cpp_int fail to compile, e.g., using {{{ cpp_int b = static_cast (a); cpp_int b = a.convert_to(); }}} What I want to happen is to divide and round down and never get it wrong even close to an int. Help? Thanks. ",Bugs,closed,To Be Determined,multiprecision,Boost 1.55.0,Problem,fixed,cpp_rational conversion,