Implements division and remainder operators for vectors.

This might have been an oversight at one point. Although the `rem_v`
and `div_v` methods are available for vectors, the actual operators
were not.

Signed-off-by: Aaron Jacobs <atheriel@gmail.com>
This commit is contained in:
Aaron Jacobs 2014-07-28 22:21:58 -07:00
parent ed5bb32f0b
commit 7e81b258a9

View file

@ -203,6 +203,14 @@ macro_rules! vec(
#[inline] fn mul(&self, v: &$Self<S>) -> $Self<S> { self.mul_v(v) }
}
impl<S: BaseNum> Div<$Self<S>, $Self<S>> for $Self<S> {
#[inline] fn div(&self, v: &$Self<S>) -> $Self<S> { self.div_v(v) }
}
impl<S: BaseNum> Rem<$Self<S>, $Self<S>> for $Self<S> {
#[inline] fn rem(&self, v: &$Self<S>) -> $Self<S> { self.rem_v(v) }
}
impl<S: BaseNum> One for $Self<S> {
#[inline] fn one() -> $Self<S> { $Self::from_value(one()) }
}