Trait rug::ops::NegAssign[][src]

pub trait NegAssign {
    fn neg_assign(&mut self);
}

Compound negation and assignment.

Examples

use rug::ops::NegAssign;
struct I(i32);
impl NegAssign for I {
    fn neg_assign(&mut self) {
        self.0 = -self.0;
    }
}
let mut i = I(42);
i.neg_assign();
assert_eq!(i.0, -42);

Required methods

fn neg_assign(&mut self)[src]

Peforms the negation.

Examples

use rug::{ops::NegAssign, Integer};
let mut i = Integer::from(-42);
i.neg_assign();
assert_eq!(i, 42);
Loading content...

Implementations on Foreign Types

impl NegAssign for i8[src]

impl NegAssign for i16[src]

impl NegAssign for i32[src]

impl NegAssign for i64[src]

impl NegAssign for i128[src]

impl NegAssign for isize[src]

impl NegAssign for f32[src]

impl NegAssign for f64[src]

Loading content...

Implementors

impl NegAssign for Float[src]

impl NegAssign for Integer[src]

Loading content...