Trait OverflowingAbs

Source
pub trait OverflowingAbs {
    type Output;

    // Required method
    fn overflowing_abs(self) -> (Self::Output, bool);
}
Expand description

Takes the absolute value of a number.

Returns a tuple of the result along with a boolean indicating whether an arithmetic overflow occured. If an overflow occurred, then the wrapped number is returned.

Required Associated Types§

Required Methods§

Source

fn overflowing_abs(self) -> (Self::Output, bool)

Implementations on Foreign Types§

Source§

impl OverflowingAbs for i8

Source§

fn overflowing_abs(self) -> (i8, bool)

This is a wrapper over the overflowing_abs functions in the standard library, for example this one.

Source§

type Output = i8

Source§

impl OverflowingAbs for i16

Source§

fn overflowing_abs(self) -> (i16, bool)

This is a wrapper over the overflowing_abs functions in the standard library, for example this one.

Source§

type Output = i16

Source§

impl OverflowingAbs for i32

Source§

fn overflowing_abs(self) -> (i32, bool)

This is a wrapper over the overflowing_abs functions in the standard library, for example this one.

Source§

type Output = i32

Source§

impl OverflowingAbs for i64

Source§

fn overflowing_abs(self) -> (i64, bool)

This is a wrapper over the overflowing_abs functions in the standard library, for example this one.

Source§

type Output = i64

Source§

impl OverflowingAbs for i128

Source§

fn overflowing_abs(self) -> (i128, bool)

This is a wrapper over the overflowing_abs functions in the standard library, for example this one.

Source§

type Output = i128

Source§

impl OverflowingAbs for isize

Source§

fn overflowing_abs(self) -> (isize, bool)

This is a wrapper over the overflowing_abs functions in the standard library, for example this one.

Source§

type Output = isize

Implementors§