Trait malachite_base::num::arithmetic::traits::OverflowingNegAssign
source · [−]pub trait OverflowingNegAssign {
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
fn overflowing_neg_assign(&mut self) -> bool
Implementations on Foreign Types
sourceimpl OverflowingNegAssign for u8
impl OverflowingNegAssign for u8
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for u16
impl OverflowingNegAssign for u16
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for u32
impl OverflowingNegAssign for u32
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for u64
impl OverflowingNegAssign for u64
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for u128
impl OverflowingNegAssign for u128
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for usize
impl OverflowingNegAssign for usize
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for i8
impl OverflowingNegAssign for i8
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for i16
impl OverflowingNegAssign for i16
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for i32
impl OverflowingNegAssign for i32
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for i64
impl OverflowingNegAssign for i64
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for i128
impl OverflowingNegAssign for i128
sourcefn overflowing_neg_assign(&mut self) -> bool
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.
sourceimpl OverflowingNegAssign for isize
impl OverflowingNegAssign for isize
sourcefn overflowing_neg_assign(&mut self) -> bool
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.