diff --git a/src/na.rs b/src/na.rs index b81c3283..311a3938 100644 --- a/src/na.rs +++ b/src/na.rs @@ -98,6 +98,30 @@ pub fn partial_cmp(a: &T, b: &T) -> PartialOrdering { PartialOrd::partial_cmp(a, b) } +/// Returns `true` iff `a` and `b` are comparable and `a < b`. +#[inline(always)] +pub fn partial_lt(a: &T, b: &T) -> bool { + PartialOrd::partial_lt(a, b) +} + +/// Returns `true` iff `a` and `b` are comparable and `a <= b`. +#[inline(always)] +pub fn partial_le(a: &T, b: &T) -> bool { + PartialOrd::partial_le(a, b) +} + +/// Returns `true` iff `a` and `b` are comparable and `a > b`. +#[inline(always)] +pub fn partial_gt(a: &T, b: &T) -> bool { + PartialOrd::partial_gt(a, b) +} + +/// Returns `true` iff `a` and `b` are comparable and `a >= b`. +#[inline(always)] +pub fn partial_ge(a: &T, b: &T) -> bool { + PartialOrd::partial_ge(a, b) +} + /// Return the minimum of `a` and `b` if they are comparable. #[inline(always)] pub fn partial_min<'a, T: PartialOrd>(a: &'a T, b: &'a T) -> Option<&'a T> {