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§
source§impl NegAssign for i8
impl NegAssign for i8
source§fn 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.
source§impl NegAssign for i16
impl NegAssign for i16
source§fn 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.
source§impl NegAssign for i32
impl NegAssign for i32
source§fn 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.
source§impl NegAssign for i64
impl NegAssign for i64
source§fn 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.
source§impl NegAssign for i128
impl NegAssign for i128
source§fn 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.
source§impl NegAssign for isize
impl NegAssign for isize
source§fn 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.
source§impl NegAssign for f32
impl NegAssign for f32
source§fn 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.
source§impl NegAssign for f64
impl NegAssign for f64
source§fn 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.