Trait malachite_base::num::arithmetic::traits::NegAssign
source · [−]pub trait NegAssign {
fn neg_assign(&mut self);
}
Expand description
Replaces a number with its negative. Assumes the result is representable.
Required Methods
fn neg_assign(&mut self)
Implementations on Foreign Types
sourceimpl NegAssign for i8
impl NegAssign for i8
sourcefn neg_assign(&mut self)
fn neg_assign(&mut self)
Negates a number in place.
Assumes that the negative can be represented.
$x \gets -x$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl NegAssign for i16
impl NegAssign for i16
sourcefn neg_assign(&mut self)
fn neg_assign(&mut self)
Negates a number in place.
Assumes that the negative can be represented.
$x \gets -x$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl NegAssign for i32
impl NegAssign for i32
sourcefn neg_assign(&mut self)
fn neg_assign(&mut self)
Negates a number in place.
Assumes that the negative can be represented.
$x \gets -x$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl NegAssign for i64
impl NegAssign for i64
sourcefn neg_assign(&mut self)
fn neg_assign(&mut self)
Negates a number in place.
Assumes that the negative can be represented.
$x \gets -x$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl NegAssign for i128
impl NegAssign for i128
sourcefn neg_assign(&mut self)
fn neg_assign(&mut self)
Negates a number in place.
Assumes that the negative can be represented.
$x \gets -x$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl NegAssign for isize
impl NegAssign for isize
sourcefn neg_assign(&mut self)
fn neg_assign(&mut self)
Negates a number in place.
Assumes that the negative can be represented.
$x \gets -x$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl NegAssign for f32
impl NegAssign for f32
sourcefn neg_assign(&mut self)
fn neg_assign(&mut self)
Negates a number in place.
Assumes that the negative can be represented.
$x \gets -x$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl NegAssign for f64
impl NegAssign for f64
sourcefn neg_assign(&mut self)
fn neg_assign(&mut self)
Negates a number in place.
Assumes that the negative can be represented.
$x \gets -x$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.