diff --git a/fixed_wide/src/fixed.rs b/fixed_wide/src/fixed.rs index 8b16620..fdda80a 100644 --- a/fixed_wide/src/fixed.rs +++ b/fixed_wide/src/fixed.rs @@ -27,6 +27,17 @@ impl PartialEq for Fixed{ } impl Eq for Fixed{} +impl PartialOrd for Fixed{ + fn partial_cmp(&self,other:&Self)->Option{ + self.bits.partial_cmp(&other.bits) + } +} +impl Ord for Fixed{ + fn cmp(&self,other:&Self)->std::cmp::Ordering{ + self.bits.cmp(&other.bits) + } +} + impl std::ops::Neg for Fixed{ type Output=Self; fn neg(self)->Self{