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
fn num_cmp(self, other: Other) -> Option<Ordering>
Same to self.partial_cmp(&other)
but can be used for different numeric types for self
and other
.
fn num_eq(self, other: Other) -> bool
Same to self == other
but can be used for different numeric types for self
and other
.
fn num_ne(self, other: Other) -> bool
Same to self != other
but can be used for different numeric types for self
and other
.
fn num_lt(self, other: Other) -> bool
Same to self < other
but can be used for different numeric types for self
and other
.
fn num_gt(self, other: Other) -> bool
Same to self > other
but can be used for different numeric types for self
and other
.
fn num_le(self, other: Other) -> bool
Same to self <= other
but can be used for different numeric types for self
and other
.
fn num_ge(self, other: Other) -> bool
Same to self >= other
but can be used for different numeric types for self
and other
.
Implementors
impl NumCmp<u8> for u8
impl NumCmp<u16> for u16
impl NumCmp<u32> for u32
impl NumCmp<u64> for u64
impl NumCmp<usize> for usize
impl NumCmp<i8> for i8
impl NumCmp<i16> for i16
impl NumCmp<i32> for i32
impl NumCmp<i64> for i64
impl NumCmp<isize> for isize
impl NumCmp<f32> for f32
impl NumCmp<f64> for f64
impl NumCmp<u8> for usize
impl NumCmp<usize> for u8
impl NumCmp<u8> for isize
impl NumCmp<isize> for u8
impl NumCmp<u16> for usize
impl NumCmp<usize> for u16
impl NumCmp<u16> for isize
impl NumCmp<isize> for u16
impl NumCmp<u32> for usize
impl NumCmp<usize> for u32
impl NumCmp<u32> for isize
impl NumCmp<isize> for u32
impl NumCmp<u64> for usize
impl NumCmp<usize> for u64
impl NumCmp<u64> for isize
impl NumCmp<isize> for u64
impl NumCmp<i8> for usize
impl NumCmp<usize> for i8
impl NumCmp<i8> for isize
impl NumCmp<isize> for i8
impl NumCmp<i16> for usize
impl NumCmp<usize> for i16
impl NumCmp<i16> for isize
impl NumCmp<isize> for i16
impl NumCmp<i32> for usize
impl NumCmp<usize> for i32
impl NumCmp<i32> for isize
impl NumCmp<isize> for i32
impl NumCmp<i64> for usize
impl NumCmp<usize> for i64
impl NumCmp<i64> for isize
impl NumCmp<isize> for i64
impl NumCmp<f32> for usize
impl NumCmp<usize> for f32
impl NumCmp<f32> for isize
impl NumCmp<isize> for f32
impl NumCmp<f64> for usize
impl NumCmp<usize> for f64
impl NumCmp<f64> for isize
impl NumCmp<isize> for f64
impl NumCmp<u8> for u64
impl NumCmp<u64> for u8
impl NumCmp<u8> for u32
impl NumCmp<u32> for u8
impl NumCmp<u8> for u16
impl NumCmp<u16> for u8
impl NumCmp<u16> for u64
impl NumCmp<u64> for u16
impl NumCmp<u16> for u32
impl NumCmp<u32> for u16
impl NumCmp<u32> for u64
impl NumCmp<u64> for u32
impl NumCmp<i8> for i64
impl NumCmp<i64> for i8
impl NumCmp<i8> for i32
impl NumCmp<i32> for i8
impl NumCmp<i8> for i16
impl NumCmp<i16> for i8
impl NumCmp<i16> for i64
impl NumCmp<i64> for i16
impl NumCmp<i16> for i32
impl NumCmp<i32> for i16
impl NumCmp<i32> for i64
impl NumCmp<i64> for i32
impl NumCmp<u8> for i64
impl NumCmp<i64> for u8
impl NumCmp<u8> for i32
impl NumCmp<i32> for u8
impl NumCmp<u8> for i16
impl NumCmp<i16> for u8
impl NumCmp<u16> for i64
impl NumCmp<i64> for u16
impl NumCmp<u16> for i32
impl NumCmp<i32> for u16
impl NumCmp<u32> for i64
impl NumCmp<i64> for u32
impl NumCmp<f32> for f64
impl NumCmp<f64> for f32
impl NumCmp<u8> for f32
impl NumCmp<f32> for u8
impl NumCmp<u16> for f32
impl NumCmp<f32> for u16
impl NumCmp<u8> for f64
impl NumCmp<f64> for u8
impl NumCmp<u16> for f64
impl NumCmp<f64> for u16
impl NumCmp<u32> for f64
impl NumCmp<f64> for u32
impl NumCmp<i8> for f32
impl NumCmp<f32> for i8
impl NumCmp<i16> for f32
impl NumCmp<f32> for i16
impl NumCmp<i8> for f64
impl NumCmp<f64> for i8
impl NumCmp<i16> for f64
impl NumCmp<f64> for i16
impl NumCmp<i32> for f64
impl NumCmp<f64> for i32
impl NumCmp<i8> for u64
impl NumCmp<u64> for i8
impl NumCmp<i8> for u32
impl NumCmp<u32> for i8
impl NumCmp<i8> for u16
impl NumCmp<u16> for i8
impl NumCmp<i8> for u8
impl NumCmp<u8> for i8
impl NumCmp<i16> for u64
impl NumCmp<u64> for i16
impl NumCmp<i16> for u32
impl NumCmp<u32> for i16
impl NumCmp<i16> for u16
impl NumCmp<u16> for i16
impl NumCmp<i32> for u64
impl NumCmp<u64> for i32
impl NumCmp<i32> for u32
impl NumCmp<u32> for i32
impl NumCmp<i64> for u64
impl NumCmp<u64> for i64
impl NumCmp<isize> for usize
impl NumCmp<usize> for isize
impl NumCmp<u32> for f32
impl NumCmp<f32> for u32
impl NumCmp<u64> for f32
impl NumCmp<f32> for u64
impl NumCmp<u64> for f64
impl NumCmp<f64> for u64
impl NumCmp<i32> for f32
impl NumCmp<f32> for i32
impl NumCmp<i64> for f32
impl NumCmp<f32> for i64
impl NumCmp<i64> for f64
impl NumCmp<f64> for i64