Abs

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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