AbsOrd

Trait AbsOrd 

Source
pub trait AbsOrd<Rhs = Self> {
    // Required method
    fn abs_cmp(&self, rhs: &Rhs) -> Ordering;
}
Expand description

Compare the magnitude of this number to the magnitude of the other number

Note that this function will panic if either of the numbers is NaN.

§Examples

assert!(5.abs_cmp(&-6).is_le());
assert!(12.3.abs_cmp(&-12.3).is_eq());

Required Methods§

Source

fn abs_cmp(&self, rhs: &Rhs) -> Ordering

Implementations on Foreign Types§

Source§

impl AbsOrd for f32

Source§

fn abs_cmp(&self, rhs: &Self) -> Ordering

Source§

impl AbsOrd for f64

Source§

fn abs_cmp(&self, rhs: &Self) -> Ordering

Source§

impl AbsOrd for i8

Source§

fn abs_cmp(&self, rhs: &Self) -> Ordering

Source§

impl AbsOrd for i16

Source§

fn abs_cmp(&self, rhs: &Self) -> Ordering

Source§

impl AbsOrd for i32

Source§

fn abs_cmp(&self, rhs: &Self) -> Ordering

Source§

impl AbsOrd for i64

Source§

fn abs_cmp(&self, rhs: &Self) -> Ordering

Source§

impl AbsOrd for i128

Source§

fn abs_cmp(&self, rhs: &Self) -> Ordering

Source§

impl AbsOrd for isize

Source§

fn abs_cmp(&self, rhs: &Self) -> Ordering

Implementors§