Trait rug::ops::MulFromRound [] [src]

pub trait MulFromRound<Lhs = Self> {
    type Round;
    type Ordering;
    fn mul_from_round(&mut self, rhs: Lhs, round: Self::Round) -> Self::Ordering;
}

Compound multiplication and assignment to the rhs operand with a specified rounding method.

Associated Types

The rounding method.

The direction from rounding.

Required Methods

Performs the multiplication.

Examples

use rug::Float;
use rug::float::Round;
use rug::ops::MulFromRound;
use std::cmp::Ordering;
// only four significant bits
let mut f = Float::with_val(4, 13);
let dir = f.mul_from_round(-3, Round::Nearest);
// -39 rounded down to -40
assert_eq!(f, -40);
assert_eq!(dir, Ordering::Less);

Implementors