Trait Abs Copy item path Source pub trait Abs:
Neg <Output = Self>
+ Ord
+ Zero {
// Provided method
fn abs (self) -> Self { ... }
}Expand description Absolute value of a number.
The default body compares against the additive identity and negates. Types that carry their
sign separately, such as the crate’s rational types, override it with a sign field write
and never touch the magnitude. This trait is deliberately not blanket-implemented: a blanket
impl would make that override impossible.
The absolute value of a number.
Compute the additive inverse if the number is smaller than the additive identity.
This trait is not dyn compatible .
In older versions of Rust, dyn compatibility was called "object safety".
§ Panics
In debug builds, when called on the most negative representable value, whose
absolute value does not fit in the type.
§ Panics
In debug builds, when called on the most negative representable value, whose
absolute value does not fit in the type.
§ Panics
In debug builds, when called on the most negative representable value, whose
absolute value does not fit in the type.
§ Panics
In debug builds, when called on the most negative representable value, whose
absolute value does not fit in the type.
§ Panics
In debug builds, when called on the most negative representable value, whose
absolute value does not fit in the type.
§ Panics
In debug builds, when called on the most negative representable value, whose
absolute value does not fit in the type.