Closed
Description
extern crate num;
use num::rational::Ratio;
fn main() {
let big = Ratio::new(128u8, 1);
let small = big.recip();
assert!(big > small);
}
fails the assertion. (It's comparing 128
with 1/128
.)
This, or something similar, happens for any type that can overflow (I guess one could argue that fixed size types are "unsupported" for rational numbers, and so this overflow leads to unspecified behaviour).
Metadata
Metadata
Assignees
Labels
No labels