Trait malachite_base::num::comparison::traits::PartialOrdAbs

source ·
pub trait PartialOrdAbs<Rhs: ?Sized = Self> {
    // Required method
    fn partial_cmp_abs(&self, other: &Rhs) -> Option<Ordering>;

    // Provided methods
    fn lt_abs(&self, other: &Rhs) -> bool { ... }
    fn le_abs(&self, other: &Rhs) -> bool { ... }
    fn gt_abs(&self, other: &Rhs) -> bool { ... }
    fn ge_abs(&self, other: &Rhs) -> bool { ... }
}
Expand description

Determines equality between the absolute values of two numbers, where some pairs of numbers may not be comparable.

Required Methods§

source

fn partial_cmp_abs(&self, other: &Rhs) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

If the two values are not comparable, None is returned.

Provided Methods§

source

fn lt_abs(&self, other: &Rhs) -> bool

Determines whether the absolute value of one number is less than the absolute value of another.

§Worst-case complexity

Same as the time and additional memory complexity of partial_cmp_abs.

source

fn le_abs(&self, other: &Rhs) -> bool

Determines whether the absolute value of one number is less than or equal to the absolute value of another.

§Worst-case complexity

Same as the time and additional memory complexity of partial_cmp_abs.

source

fn gt_abs(&self, other: &Rhs) -> bool

Determines whether the absolute value of one number is greater than the absolute value of another.

§Worst-case complexity

Same as the time and additional memory complexity of partial_cmp_abs.

source

fn ge_abs(&self, other: &Rhs) -> bool

Determines whether the absolute value of one number is greater than or equal to the absolute value of another.

§Worst-case complexity

Same as the time and additional memory complexity of partial_cmp_abs.

Implementations on Foreign Types§

source§

impl PartialOrdAbs for f32

source§

fn partial_cmp_abs(&self, other: &Self) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

For unsigned values, this is the same as ordinary comparison.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for f64

source§

fn partial_cmp_abs(&self, other: &Self) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

For unsigned values, this is the same as ordinary comparison.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for i8

source§

fn partial_cmp_abs(&self, other: &i8) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for i16

source§

fn partial_cmp_abs(&self, other: &i16) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for i32

source§

fn partial_cmp_abs(&self, other: &i32) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for i64

source§

fn partial_cmp_abs(&self, other: &i64) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for i128

source§

fn partial_cmp_abs(&self, other: &i128) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for isize

source§

fn partial_cmp_abs(&self, other: &isize) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for u8

source§

fn partial_cmp_abs(&self, other: &u8) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for u16

source§

fn partial_cmp_abs(&self, other: &u16) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for u32

source§

fn partial_cmp_abs(&self, other: &u32) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for u64

source§

fn partial_cmp_abs(&self, other: &u64) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for u128

source§

fn partial_cmp_abs(&self, other: &u128) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl PartialOrdAbs for usize

source§

fn partial_cmp_abs(&self, other: &usize) -> Option<Ordering>

Compares the absolute values of two numbers, taking both by reference.

The PartialOrdAbs interface allows for pairs of incomparable elements, but for primitive integers these never occur.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Implementors§