Issue by klutzy
Wednesday Aug 27, 2014 at 07:50 GMT
For earlier discussion, see rust-lang/rust#16782
This issue was labelled with: in the Rust repository
use std::i64::MIN;
use:num::rational::Ratio;
let a = Ratio::new(1, MIN);
Here a actually is -1 / MIN due to overflow in reduce():
// keep denom positive!
if self.denom < Zero::zero() {
self.numer = -self.numer;
self.denom = -self.denom;
}
Wednesday Aug 27, 2014 at 07:50 GMT
For earlier discussion, see rust-lang/rust#16782
This issue was labelled with: in the Rust repository
Here
aactually is-1 / MINdue to overflow inreduce():