Trait rug::ops::PowFrom[][src]

pub trait PowFrom<Lhs = Self> {
    fn pow_from(&mut self, lhs: Lhs);
}

Compound power operation and assignment to the rhs operand.

rhs.pow_from(lhs) has the same effect as rhs = lhs.pow(rhs).

Examples

use rug::ops::PowFrom;
struct U(u32);
impl PowFrom<u32> for U {
    fn pow_from(&mut self, lhs: u32) {
        self.0 = lhs.pow(self.0);
    }
}
let mut u = U(2);
u.pow_from(5);
assert_eq!(u.0, 25);

Required methods

fn pow_from(&mut self, lhs: Lhs)[src]

Peforms the power operation.

Examples

use rug::{ops::PowFrom, Float};
let mut rhs = Float::with_val(53, 5);
rhs.pow_from(10);
// rhs = 10 ^ 5
assert_eq!(rhs, 100_000);
Loading content...

Implementations on Foreign Types

impl PowFrom<u32> for u32[src]

impl PowFrom<&'_ u32> for u32[src]

impl PowFrom<f32> for f32[src]

impl PowFrom<&'_ f32> for f32[src]

impl PowFrom<f64> for f64[src]

impl PowFrom<&'_ f64> for f64[src]

Loading content...

Implementors

impl PowFrom<&'_ f32> for Float[src]

impl PowFrom<&'_ f64> for Float[src]

impl PowFrom<&'_ i8> for Float[src]

impl PowFrom<&'_ i16> for Float[src]

impl PowFrom<&'_ i32> for Float[src]

impl PowFrom<&'_ i64> for Float[src]

impl PowFrom<&'_ i128> for Float[src]

impl PowFrom<&'_ u8> for Float[src]

impl PowFrom<&'_ u16> for Float[src]

impl PowFrom<&'_ u32> for Float[src]

impl PowFrom<&'_ u64> for Float[src]

impl PowFrom<&'_ u128> for Float[src]

impl PowFrom<&'_ Float> for Float[src]

impl PowFrom<f32> for Float[src]

impl PowFrom<f64> for Float[src]

impl PowFrom<i8> for Float[src]

impl PowFrom<i16> for Float[src]

impl PowFrom<i32> for Float[src]

impl PowFrom<i64> for Float[src]

impl PowFrom<i128> for Float[src]

impl PowFrom<u8> for Float[src]

impl PowFrom<u16> for Float[src]

impl PowFrom<u32> for Float[src]

impl PowFrom<u64> for Float[src]

impl PowFrom<u128> for Float[src]

impl PowFrom<Float> for Float[src]

Loading content...