Trait Abs

Source
pub trait Abs {
    // Required method
    const fn abs(self) -> Self;
}
Expand description

✅ The absolute value of self.

§Panics

This function never panics. If the value is the minimum representable number, it returns the nearest valid value (e.g. Self::MAX).

Required Methods§

Source

const fn abs(self) -> Self

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 Abs for Dec19x19

§Tests

check!( [Dec19x19::abs] {
    (Dec19x19::MAX)   => Dec19x19::MAX,
    (Dec19x19!(3.0))  => Dec19x19!(3.0),
    (Dec19x19!(0.0))  => Dec19x19!(0.0),
    (Dec19x19!(-3.0)) => Dec19x19!(3.0),
    (Dec19x19::MIN)   => Dec19x19::MAX,
});