Trait typenum::type_operators::Pow
[−]
[src]
pub trait Pow<Exp> { type Output; fn powi(self, exp: Exp) -> Self::Output; }
A type operator that provides exponentiation by repeated squaring.
Example
use typenum::{Pow, N3, P3, Integer}; assert_eq!(<N3 as Pow<P3>>::Output::to_i32(), -27);
Associated Types
type Output
The result of the exponentiation.
Required Methods
fn powi(self, exp: Exp) -> Self::Output
This function isn't used in this crate, but may be useful for others. It is implemented for primitives.
Example
use typenum::{Pow, U3}; let a = 7u32.powi(U3::new()); let b = 7u32.pow(3); assert_eq!(a, b); let x = 3.0.powi(U3::new()); let y = 27.0; assert_eq!(x, y);
Implementors
impl<X: Unsigned, N: Unsigned> Pow<N> for X where X: PrivatePow<U1, N>
impl Pow<Z0> for typenum::int::Z0
impl<U: Unsigned + NonZero> Pow<PInt<U>> for typenum::int::Z0
impl<U: Unsigned + NonZero> Pow<NInt<U>> for typenum::int::Z0
impl<U: Unsigned + NonZero> Pow<NInt<U>> for P1
impl<U: Unsigned> Pow<NInt<UInt<U, B0>>> for typenum::consts::N1
impl<U: Unsigned> Pow<NInt<UInt<U, B1>>> for typenum::consts::N1
impl<U: Unsigned + NonZero> Pow<Z0> for typenum::int::PInt<U>
impl<U: Unsigned + NonZero> Pow<Z0> for typenum::int::NInt<U>
impl<Ul: Unsigned + NonZero, Ur: Unsigned + NonZero> Pow<PInt<Ur>> for typenum::int::PInt<Ul> where Ul: Pow<Ur>,
Ul::Output: Unsigned + NonZeroimpl<Ul: Unsigned + NonZero, Ur: Unsigned> Pow<PInt<UInt<Ur, B0>>> for typenum::int::NInt<Ul> where Ul: Pow<UInt<Ur, B0>>,
Ul::Output: Unsigned + NonZeroimpl<Ul: Unsigned + NonZero, Ur: Unsigned> Pow<PInt<UInt<Ur, B1>>> for typenum::int::NInt<Ul> where Ul: Pow<UInt<Ur, B1>>,
Ul::Output: Unsigned + NonZeroimpl Pow<UTerm> for f32
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for f32
impl Pow<Z0> for f32
impl<U: Unsigned + NonZero> Pow<PInt<U>> for f32
impl Pow<UTerm> for f64
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for f64
impl Pow<Z0> for f64
impl<U: Unsigned + NonZero> Pow<PInt<U>> for f64
impl Pow<UTerm> for u8
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for u8
impl Pow<Z0> for u8
impl<U: Unsigned + NonZero> Pow<PInt<U>> for u8
impl Pow<UTerm> for u16
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for u16
impl Pow<Z0> for u16
impl<U: Unsigned + NonZero> Pow<PInt<U>> for u16
impl Pow<UTerm> for u32
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for u32
impl Pow<Z0> for u32
impl<U: Unsigned + NonZero> Pow<PInt<U>> for u32
impl Pow<UTerm> for u64
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for u64
impl Pow<Z0> for u64
impl<U: Unsigned + NonZero> Pow<PInt<U>> for u64
impl Pow<UTerm> for usize
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for usize
impl Pow<Z0> for usize
impl<U: Unsigned + NonZero> Pow<PInt<U>> for usize
impl Pow<UTerm> for i8
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for i8
impl Pow<Z0> for i8
impl<U: Unsigned + NonZero> Pow<PInt<U>> for i8
impl Pow<UTerm> for i16
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for i16
impl Pow<Z0> for i16
impl<U: Unsigned + NonZero> Pow<PInt<U>> for i16
impl Pow<UTerm> for i32
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for i32
impl Pow<Z0> for i32
impl<U: Unsigned + NonZero> Pow<PInt<U>> for i32
impl Pow<UTerm> for i64
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for i64
impl Pow<Z0> for i64
impl<U: Unsigned + NonZero> Pow<PInt<U>> for i64
impl Pow<UTerm> for isize
impl<U: Unsigned, B: Bit> Pow<UInt<U, B>> for isize
impl Pow<Z0> for isize
impl<U: Unsigned + NonZero> Pow<PInt<U>> for isize