pub trait Abs {
type Output;
// Required method
fn abs(self) -> Self::Output;
}Expand description
Abs function in a component way
Required Associated Types§
Required Methods§
Sourcefn abs(self) -> Self::Output
fn abs(self) -> Self::Output
Absolute value in a component way.
§Overflow behavior
The absolute value of iX::MIN cannot be represented as an iX, and attempting to calculate it will cause an overflow.
This means that code in debug mode will trigger a panic on this case and optimized code will return iX::MIN without a panic.
Can cause a panic for grid if the size mismatch