pub trait ExtNum: Clone {
type AbsOut: Clone + ExtNum<AbsOut = Self::AbsOut>;
const ABS_UNCHANGED: bool;
const ABS_SAME_TYPE: bool;
// Required methods
fn ext_abs(self) -> Self::AbsOut;
fn ext_abs_diff(self, other: Self) -> Self::AbsOut;
fn ext_real(self) -> Self::AbsOut;
fn ext_imag(self) -> Self::AbsOut;
// Provided method
fn is_nan(&self) -> bool { ... }
}Required Associated Constants§
Sourceconst ABS_UNCHANGED: bool
const ABS_UNCHANGED: bool
Whether the absolute value operation does not change the value.
Sourceconst ABS_SAME_TYPE: bool
const ABS_SAME_TYPE: bool
Whether the output type of the absolute value operation is the same as the input type.
Required Associated Types§
Required Methods§
Sourcefn ext_abs_diff(self, other: Self) -> Self::AbsOut
fn ext_abs_diff(self, other: Self) -> Self::AbsOut
Computes the absolute difference between two numbers.
For most cases, this is equivalent to (self - other).ext_abs().
However, for unsigned integer types, this avoids potential underflow.
Provided Methods§
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.