Trait NegAssign

Source
pub trait NegAssign {
    // Required method
    fn neg_assign(&mut self);
}
Expand description

Replaces a number with its negative. Assumes the result is representable.

Required Methods§

Source

fn neg_assign(&mut self)

Implementations on Foreign Types§

Source§

impl NegAssign for f32

Source§

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

Source§

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 i8

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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.

Implementors§