Trait rug::ops::Pow
[−]
[src]
pub trait Pow<Rhs> { type Output; fn pow(self, rhs: Rhs) -> Self::Output; }
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(rhs as u32) } } let u = U(5); assert_eq!(u.pow(2_u16), 25);
Associated Types
type Output
The resulting type after the power operation.
Required Methods
fn pow(self, rhs: Rhs) -> Self::Output
Performs the power operation.
Examples
use rug::Integer; use rug::ops::Pow; let base = Integer::from(10); let ans = base.pow(5); assert_eq!(ans, 100_000);
Implementations on Foreign Types
impl Pow<u32> for i8
[src]
impl Pow<u32> for i16
[src]
impl Pow<u32> for i32
[src]
impl Pow<u32> for i64
[src]
impl Pow<u32> for isize
[src]
impl Pow<u32> for u8
[src]
impl Pow<u32> for u16
[src]
impl Pow<u32> for u32
[src]
impl Pow<u32> for u64
[src]
impl Pow<u32> for usize
[src]
impl Pow<i32> for f32
[src]
impl Pow<f32> for f32
[src]
impl Pow<i32> for f64
[src]
impl Pow<f64> for f64
[src]
impl Pow<Float> for u32
[src]
impl<'a> Pow<&'a Float> for u32
[src]
impl Pow<Float> for i32
[src]
impl<'a> Pow<&'a Float> for i32
[src]
impl Pow<Float> for f64
[src]
impl<'a> Pow<&'a Float> for f64
[src]
impl Pow<Float> for f32
[src]
impl<'a> Pow<&'a Float> for f32
[src]
Implementors
impl Pow<u32> for Integer type Output = Integer;
impl<'a> Pow<u32> for &'a Integer type Output = PowRefU32<'a>;
impl Pow<i32> for Rational type Output = Rational;
impl<'a> Pow<i32> for &'a Rational type Output = PowRefI32<'a>;
impl Pow<u32> for Rational type Output = Rational;
impl<'a> Pow<u32> for &'a Rational type Output = PowRefU32<'a>;
impl Pow<Float> for Float type Output = Float;
impl<'a> Pow<&'a Float> for Float type Output = Float;
impl<'a> Pow<&'a Float> for &'a Float type Output = PowRef<'a>;
impl<'a> Pow<Float> for &'a Float type Output = Float;
impl Pow<Integer> for Float type Output = Float;
impl<'a> Pow<&'a Integer> for Float type Output = Float;
impl<'a> Pow<&'a Integer> for &'a Float type Output = PowRefInteger<'a>;
impl<'a> Pow<Integer> for &'a Float type Output = PowRefIntegerOwn<'a>;
impl Pow<u32> for Float type Output = Float;
impl<'a> Pow<u32> for &'a Float type Output = PowRefU32<'a>;
impl Pow<i32> for Float type Output = Float;
impl<'a> Pow<i32> for &'a Float type Output = PowRefI32<'a>;
impl Pow<f64> for Float type Output = Float;
impl<'a> Pow<f64> for &'a Float type Output = PowRefF64<'a>;
impl Pow<f32> for Float type Output = Float;
impl<'a> Pow<f32> for &'a Float type Output = PowRefF32<'a>;
impl Pow<Complex> for Complex type Output = Complex;
impl<'a> Pow<&'a Complex> for Complex type Output = Complex;
impl<'a> Pow<&'a Complex> for &'a Complex type Output = PowRef<'a>;
impl<'a> Pow<Complex> for &'a Complex type Output = Complex;
impl Pow<Float> for Complex type Output = Complex;
impl<'a> Pow<&'a Float> for Complex type Output = Complex;
impl<'a> Pow<&'a Float> for &'a Complex type Output = PowRefFloat<'a>;
impl<'a> Pow<Float> for &'a Complex type Output = PowRefFloatOwn<'a>;
impl Pow<Integer> for Complex type Output = Complex;
impl<'a> Pow<&'a Integer> for Complex type Output = Complex;
impl<'a> Pow<&'a Integer> for &'a Complex type Output = PowRefInteger<'a>;
impl<'a> Pow<Integer> for &'a Complex type Output = PowRefIntegerOwn<'a>;
impl Pow<u32> for Complex type Output = Complex;
impl<'a> Pow<u32> for &'a Complex type Output = PowRefU32<'a>;
impl Pow<i32> for Complex type Output = Complex;
impl<'a> Pow<i32> for &'a Complex type Output = PowRefI32<'a>;
impl Pow<f64> for Complex type Output = Complex;
impl<'a> Pow<f64> for &'a Complex type Output = PowRefF64<'a>;
impl Pow<f32> for Complex type Output = Complex;
impl<'a> Pow<f32> for &'a Complex type Output = PowRefF32<'a>;