Trait num_cmp::NumCmp [] [src]

pub trait NumCmp<Other: Copy>: Copy {
    fn num_cmp(self, other: Other) -> Option<Ordering>;
    fn num_eq(self, other: Other) -> bool;
    fn num_ne(self, other: Other) -> bool;
    fn num_lt(self, other: Other) -> bool;
    fn num_gt(self, other: Other) -> bool;
    fn num_le(self, other: Other) -> bool;
    fn num_ge(self, other: Other) -> bool;
}

A trait for comparison between differently typed numbers.

This trait is implemented for every pair of integer and floating-point types available, including isize, usize and also (when the i128 feature is enabled) i128 and u128.

Required Methods

Same to self.partial_cmp(&other) but can be used for different numeric types for self and other.

Same to self == other but can be used for different numeric types for self and other.

Same to self != other but can be used for different numeric types for self and other.

Same to self < other but can be used for different numeric types for self and other.

Same to self > other but can be used for different numeric types for self and other.

Same to self <= other but can be used for different numeric types for self and other.

Same to self >= other but can be used for different numeric types for self and other.

Implementors