Fraction::floor rounds negative Fractions upwards (towards zero), and Fraction::ceil rounds negative fractions towards negative infinity. Since the docs says that floor should "Returns the largest integer less than or equal to the value" I'm assuming this is unintentional
let f = Fraction::new_neg(1u8, 2u8);
println!("{} {}", f.floor(), f.ceil());
This example prints -0 -1 when the output should be -1 -0
Fraction::floor
rounds negative Fractions upwards (towards zero), andFraction::ceil
rounds negative fractions towards negative infinity. Since the docs says thatfloor
should "Returns the largest integer less than or equal to the value" I'm assuming this is unintentionalThis example prints
-0 -1
when the output should be-1 -0