Trait rug::ops::MulRound [] [src]

pub trait MulRound<Rhs = Self> {
    type Round;
    type Ordering;
    type Output;
    fn mul_round(
        self,
        rhs: Rhs,
        round: Self::Round
    ) -> (Self::Output, Self::Ordering); }

Multiplication with a specified rounding method.

Associated Types

The rounding method.

The direction from rounding.

The resulting type after the multiplication.

Required Methods

Performs the multiplication.

Examples

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

Implementors