diff -r 37c99587825d -r 3078123e84ea rust/fpnum/src/lib.rs --- a/rust/fpnum/src/lib.rs Mon Nov 05 21:36:28 2018 +0100 +++ b/rust/fpnum/src/lib.rs Tue Nov 06 00:02:23 2018 +0100 @@ -455,6 +455,17 @@ self.y().$name(rhs)) } } + }; + ($($op: tt)::+<$arg: tt>, $name: tt) => { + impl $($op)::+<$arg> for FPPoint { + type Output = Self; + + #[inline] + fn $name(self, rhs: $arg) -> Self { + Self::new(self.x().$name(rhs), + self.y().$name(rhs)) + } + } } } @@ -480,6 +491,7 @@ right_scalar_bin_op_impl!(ops::Mul, mul); right_scalar_bin_op_impl!(ops::Sub, sub); right_scalar_bin_op_impl!(ops::Div, div); +right_scalar_bin_op_impl!(ops::Div, div); left_scalar_bin_op_impl!(ops::Mul, mul); macro_rules! bin_assign_op_impl {