diff --git a/src/lib.rs b/src/lib.rs index 41812a2..c5d3418 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -195,6 +195,12 @@ impl Neg for OrderedFloat { } } +impl Zero for OrderedFloat { + fn zero() -> Self { OrderedFloat(T::zero()) } + + fn is_zero(&self) -> bool { self.0.is_zero() } +} + /// A wrapper around Floats providing an implementation of Ord and Hash. /// /// A NaN value cannot be stored in this type.