diff --git a/deferred_division/src/ratio.rs b/deferred_division/src/ratio.rs index c5abad4..edc386e 100644 --- a/deferred_division/src/ratio.rs +++ b/deferred_division/src/ratio.rs @@ -86,6 +86,21 @@ macro_rules! impl_operator { } } } + impl core::ops::$trait<$struct> for Lhs + where + Den:Copy, + Lhs:Mul, + >::Output:core::ops::$trait, + { + type Output=$struct<<>::Output as core::ops::$trait>::Output,Den>; + + fn $method(self,rhs:$struct)->Self::Output{ + $struct{ + num:self.mul(rhs.den).$method(rhs.num), + den:rhs.den, + } + } + } }; } macro_rules! impl_assign_operator{