id summary reporter owner description type status milestone component version severity resolution keywords cc 13101 multiplication overflow issue Robert Ramey Daryle Walker "The following code will result in erroneous output due to integer overflow. {{{ rational x {1, INT_MAX}; rational y {1, 2}; rational z = x * y; // will result in error due to overflow }}} The relevant section of the library code - rational.hpp line 500 is {{{ // Avoid overflow and preserve normalization IntType gcd1 = integer::gcd(num, r_den); IntType gcd2 = integer::gcd(r_num, den); num = (num/gcd1) * (r_num/gcd2); den = (den/gcd2) * (r_den/gcd1); }}} which, in spite of comment, does not implement any checking for overflow. The same argument applies to addition and likely other operations. Division does check for divide by zero and throws an exception. The documentation itself is kind of cagey on the issue. In spite of having opened this issue I'm not sure what I really want to ask for. Sorry about this. Longer term I would hope to see rational and multi precision integers not include any checking and permit safe integer do it. But of course I'm not there yet. " Feature Requests new To Be Determined rational Boost 1.63.0 Problem