pub trait OverflowingNegAssign {
    // Required method
    fn overflowing_neg_assign(&mut self) -> bool;
}
Expand description

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped number is assigned.

Required Methods§

Implementations on Foreign Types§

source§

impl OverflowingNegAssign for i8

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for i16

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for i32

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for i64

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for i128

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for isize

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for u8

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for u16

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for u32

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for u64

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for u128

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl OverflowingNegAssign for usize

source§

fn overflowing_neg_assign(&mut self) -> bool

Negates a number in place.

Returns a boolean indicating whether an arithmetic overflow occurred. If an overflow occurred, then the wrapped value is assigned.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Implementors§