diff --git a/lib/fixed_wide/src/fixed.rs b/lib/fixed_wide/src/fixed.rs index 58aae16..0426805 100644 --- a/lib/fixed_wide/src/fixed.rs +++ b/lib/fixed_wide/src/fixed.rs @@ -1,6 +1,6 @@ use bnum::{BInt,cast::As}; -#[derive(Clone,Copy,Debug,Default,Hash)] +#[derive(Clone,Copy,Debug,Default,Hash,PartialEq,PartialOrd,Ord)] /// A Fixed point number for which multiply operations widen the bits in the output. (when the wide-mul feature is enabled) /// N is the number of u64s to use /// F is the number of fractional bits (always N*32 lol) @@ -87,12 +87,6 @@ impl_from!( i8,i16,i32,i64,i128,isize ); -impl PartialEq for Fixed{ - #[inline] - fn eq(&self,other:&Self)->bool{ - self.bits.eq(&other.bits) - } -} impl PartialEq for Fixed where T:Copy, @@ -105,12 +99,6 @@ where } impl Eq for Fixed{} -impl PartialOrd for Fixed{ - #[inline] - fn partial_cmp(&self,other:&Self)->Option{ - self.bits.partial_cmp(&other.bits) - } -} impl PartialOrd for Fixed where T:Copy, @@ -121,12 +109,6 @@ impl PartialOrd for Fixed self.bits.partial_cmp(&other.into()) } } -impl Ord for Fixed{ - #[inline] - fn cmp(&self,other:&Self)->std::cmp::Ordering{ - self.bits.cmp(&other.bits) - } -} impl std::ops::Neg for Fixed{ type Output=Self;