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)
Peforms the power operation.
Examples
use rug::Float; use rug::ops::PowFrom; let mut rhs = Float::with_val(53, 5); rhs.pow_from(10); // rhs = 10 ** 5 assert_eq!(rhs, 100_000);
Implementors
impl PowFrom for u32
impl PowFrom for f32
impl PowFrom for f64
impl PowFrom<Float> for Float
impl<'a> PowFrom<&'a Float> for Float
impl<'a> PowFrom<u32> for Float
impl<'a> PowFrom<i32> for Float
impl<'a> PowFrom<f64> for Float
impl<'a> PowFrom<f32> for Float
impl PowFrom<Complex> for Complex
impl<'a> PowFrom<&'a Complex> for Complex