num-rational
num-rational copied to clipboard
Rational<T> should implement CheckedNeg whenever T does
Negating a Rational64 such as Rational64::new(i64::MIN, 3) will overflow, and without CheckedNeg it's annoying to catch it.
(I think this shouldn't be a breaking change? Although I confess that I don't understand all the semver subtleties around traits.)
Adding a new trait impl should be fine! I think it would only be a semver issue if you added a T: CheckedNeg requirement to some existing API surface.