Trait rug::ops::PowFrom [−][src]
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);