diff --git a/src/angle.rs b/src/angle.rs index 922ee24..ba5342d 100644 --- a/src/angle.rs +++ b/src/angle.rs @@ -22,7 +22,7 @@ use std::ops::*; use rand::{Rand, Rng}; use rand::distributions::range::SampleRange; -use num_traits::cast; +use num_traits::{cast, Bounded}; use structure::*; @@ -117,6 +117,18 @@ macro_rules! impl_angle { fn neg(self) -> $Angle { $Angle(-self.0) } } + impl Bounded for $Angle { + #[inline] + fn min_value() -> $Angle { + $Angle(S::min_value()) + } + + #[inline] + fn max_value() -> $Angle { + $Angle(S::max_value()) + } + } + impl_operator!( Add<$Angle > for $Angle { fn add(lhs, rhs) -> $Angle { $Angle(lhs.0 + rhs.0) } });