Trait malachite_base::num::arithmetic::traits::OverflowingNeg

source ·
pub trait OverflowingNeg {
    type Output;

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

Negates a number.

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

Required Associated Types§

Required Methods§

source

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

Implementations on Foreign Types§

source§

impl OverflowingNeg for i8

source§

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

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

§

type Output = i8

source§

impl OverflowingNeg for i16

source§

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

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

§

type Output = i16

source§

impl OverflowingNeg for i32

source§

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

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

§

type Output = i32

source§

impl OverflowingNeg for i64

source§

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

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

§

type Output = i64

source§

impl OverflowingNeg for i128

source§

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

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

§

type Output = i128

source§

impl OverflowingNeg for isize

source§

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

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

§

type Output = isize

source§

impl OverflowingNeg for u8

source§

fn overflowing_neg(self) -> (u8, bool)

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

§

type Output = u8

source§

impl OverflowingNeg for u16

source§

fn overflowing_neg(self) -> (u16, bool)

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

§

type Output = u16

source§

impl OverflowingNeg for u32

source§

fn overflowing_neg(self) -> (u32, bool)

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

§

type Output = u32

source§

impl OverflowingNeg for u64

source§

fn overflowing_neg(self) -> (u64, bool)

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

§

type Output = u64

source§

impl OverflowingNeg for u128

source§

fn overflowing_neg(self) -> (u128, bool)

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

§

type Output = u128

source§

impl OverflowingNeg for usize

source§

fn overflowing_neg(self) -> (usize, bool)

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

§

type Output = usize

Implementors§