Trait rug::ops::Pow[][src]

pub trait Pow<Rhs> {
    type Output;
    fn pow(self, rhs: Rhs) -> Self::Output;
}
Expand description

The power operation.

Examples

use rug::ops::Pow;
struct U(u32);
impl Pow<u16> for U {
    type Output = u32;
    fn pow(self, rhs: u16) -> u32 {
        self.0.pow(u32::from(rhs))
    }
}
let u = U(5);
assert_eq!(u.pow(2_u16), 25);

Associated Types

The resulting type after the power operation.

Required methods

Performs the power operation.

Examples

use rug::{ops::Pow, Integer};
let base = Integer::from(10);
let power = base.pow(5);
assert_eq!(power, 100_000);

Implementations on Foreign Types

Implementors