Trait typenum::type_operators::Pow [−][src]
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
Loading content...Required methods
fn powi(self, exp: Exp) -> Self::Output
[src]
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<Ul: Unsigned + NonZero, Ur: Unsigned + NonZero> Pow<PInt<Ur>> for PInt<Ul> where
Ul: Pow<Ur>,
<Ul as Pow<Ur>>::Output: Unsigned + NonZero,
[src]
impl<Ul: Unsigned + NonZero, Ur: Unsigned + NonZero> Pow<PInt<Ur>> for PInt<Ul> where
Ul: Pow<Ur>,
<Ul as Pow<Ur>>::Output: Unsigned + NonZero,
[src]P(Ul)^P(Ur) = P(Ul^Ur)
impl<Ul: Unsigned + NonZero, Ur: Unsigned> Pow<PInt<UInt<Ur, B0>>> for NInt<Ul> where
Ul: Pow<UInt<Ur, B0>>,
<Ul as Pow<UInt<Ur, B0>>>::Output: Unsigned + NonZero,
[src]
impl<Ul: Unsigned + NonZero, Ur: Unsigned> Pow<PInt<UInt<Ur, B0>>> for NInt<Ul> where
Ul: Pow<UInt<Ur, B0>>,
<Ul as Pow<UInt<Ur, B0>>>::Output: Unsigned + NonZero,
[src]N(Ul)^P(Ur) = P(Ul^Ur) if Ur is even