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§
sourcefn partial_cmp_abs(&self, other: &Rhs) -> Option<Ordering>
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§
sourcefn lt_abs(&self, other: &Rhs) -> bool
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
.
sourcefn le_abs(&self, other: &Rhs) -> bool
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
.
Implementations on Foreign Types§
source§impl PartialOrdAbs for f32
impl PartialOrdAbs for f32
source§impl PartialOrdAbs for f64
impl PartialOrdAbs for f64
source§impl PartialOrdAbs for i8
impl PartialOrdAbs for i8
source§fn partial_cmp_abs(&self, other: &i8) -> Option<Ordering>
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
impl PartialOrdAbs for i16
source§fn partial_cmp_abs(&self, other: &i16) -> Option<Ordering>
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
impl PartialOrdAbs for i32
source§fn partial_cmp_abs(&self, other: &i32) -> Option<Ordering>
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
impl PartialOrdAbs for i64
source§fn partial_cmp_abs(&self, other: &i64) -> Option<Ordering>
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
impl PartialOrdAbs for i128
source§fn partial_cmp_abs(&self, other: &i128) -> Option<Ordering>
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
impl PartialOrdAbs for isize
source§fn partial_cmp_abs(&self, other: &isize) -> Option<Ordering>
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
impl PartialOrdAbs for u8
source§fn partial_cmp_abs(&self, other: &u8) -> Option<Ordering>
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
impl PartialOrdAbs for u16
source§fn partial_cmp_abs(&self, other: &u16) -> Option<Ordering>
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
impl PartialOrdAbs for u32
source§fn partial_cmp_abs(&self, other: &u32) -> Option<Ordering>
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
impl PartialOrdAbs for u64
source§fn partial_cmp_abs(&self, other: &u64) -> Option<Ordering>
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
impl PartialOrdAbs for u128
source§fn partial_cmp_abs(&self, other: &u128) -> Option<Ordering>
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
impl PartialOrdAbs for usize
source§fn partial_cmp_abs(&self, other: &usize) -> Option<Ordering>
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.