Trait relp_num::Abs

source ·
pub trait Abs: Neg<Output = Self> + Ord + Zero {
    // Provided method
    fn abs(self) -> Self { ... }
}
Expand description

Absolute value of a number.

Automatically implemented for all types satisfying the trait’s bounds.

Provided Methods§

source

fn abs(self) -> Self

The absolute value of a number.

Compute the additive inverse if the number is smaller than the additive identity.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Neg<Output = Self> + Ord + Zero> Abs for T