Trait libp2p::multiaddr::multihash::typenum::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
pub 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);
Implementations on Foreign Types
impl<U> Pow<PInt<U>> for f32 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl<U> Pow<PInt<U>> for i16 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl Pow<UTerm> for u32
[src]
impl<U, B> Pow<UInt<U, B>> for i16 where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl Pow<Z0> for isize
[src]
impl Pow<UTerm> for u16
[src]
impl<U, B> Pow<UInt<U, B>> for i64 where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl Pow<UTerm> for f64
[src]
impl Pow<Z0> for f64
[src]
impl<U, B> Pow<UInt<U, B>> for i8 where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl Pow<Z0> for i64
[src]
impl<U> Pow<PInt<U>> for usize where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl<U, B> Pow<UInt<U, B>> for u64 where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl Pow<Z0> for u64
[src]
impl<U, B> Pow<UInt<U, B>> for usize where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl<U> Pow<PInt<U>> for u16 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl<U> Pow<PInt<U>> for i64 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl Pow<UTerm> for i8
[src]
impl<U, B> Pow<UInt<U, B>> for u32 where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl Pow<UTerm> for u64
[src]
impl<U> Pow<PInt<U>> for isize where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl Pow<UTerm> for usize
[src]
impl Pow<Z0> for f32
[src]
impl Pow<UTerm> for i16
[src]
impl Pow<Z0> for i8
[src]
impl<U> Pow<PInt<U>> for u8 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl Pow<UTerm> for isize
[src]
impl Pow<UTerm> for i64
[src]
impl Pow<Z0> for u16
[src]
impl<U, B> Pow<UInt<U, B>> for u16 where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl<U> Pow<PInt<U>> for u64 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl Pow<UTerm> for i32
[src]
impl Pow<Z0> for u8
[src]
impl<U> Pow<PInt<U>> for i32 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl<U, B> Pow<UInt<U, B>> for isize where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl<U, B> Pow<UInt<U, B>> for u8 where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl<U> Pow<PInt<U>> for f64 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl Pow<UTerm> for u8
[src]
impl Pow<UTerm> for f32
[src]
impl<U, B> Pow<UInt<U, B>> for f32 where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl<U, B> Pow<UInt<U, B>> for f64 where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl Pow<Z0> for i16
[src]
impl<U> Pow<PInt<U>> for i8 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl<U> Pow<PInt<U>> for u32 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
impl Pow<Z0> for i32
[src]
impl Pow<Z0> for usize
[src]
impl<U, B> Pow<UInt<U, B>> for i32 where
B: Bit,
U: Unsigned,
[src]
B: Bit,
U: Unsigned,
impl Pow<Z0> for u32
[src]
Loading content...Implementors
impl Pow<Z0> for Z0
[src]
0^0 = 1
impl<U> Pow<NInt<UInt<U, B0>>> for NInt<UInt<UTerm, B1>> where
U: Unsigned,
[src]
U: Unsigned,
(-1)^N = 1 if N is even
type Output = PInt<UInt<UTerm, B1>>
pub fn powi(
self,
NInt<UInt<U, B0>>
) -> <NInt<UInt<UTerm, B1>> as Pow<NInt<UInt<U, B0>>>>::Output
[src]
self,
NInt<UInt<U, B0>>
) -> <NInt<UInt<UTerm, B1>> as Pow<NInt<UInt<U, B0>>>>::Output
impl<U> Pow<NInt<UInt<U, B1>>> for NInt<UInt<UTerm, B1>> where
U: Unsigned,
[src]
U: Unsigned,
(-1)^N = -1 if N is odd
type Output = NInt<UInt<UTerm, B1>>
pub fn powi(
self,
NInt<UInt<U, B1>>
) -> <NInt<UInt<UTerm, B1>> as Pow<NInt<UInt<U, B1>>>>::Output
[src]
self,
NInt<UInt<U, B1>>
) -> <NInt<UInt<UTerm, B1>> as Pow<NInt<UInt<U, B1>>>>::Output
impl<U> Pow<NInt<U>> for PInt<UInt<UTerm, B1>> where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
1^N = 1
type Output = PInt<UInt<UTerm, B1>>
pub fn powi(self, NInt<U>) -> <PInt<UInt<UTerm, B1>> as Pow<NInt<U>>>::Output
[src]
impl<U> Pow<NInt<U>> for Z0 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
0^N = 0
impl<U> Pow<PInt<U>> for Z0 where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
0^P = 0
impl<U> Pow<Z0> for NInt<U> where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
N^0 = 1
impl<U> Pow<Z0> for PInt<U> where
U: Unsigned + NonZero,
[src]
U: Unsigned + NonZero,
P^0 = 1
impl<Ul, Ur> Pow<PInt<UInt<Ur, B0>>> for NInt<Ul> where
Ul: Unsigned + NonZero + Pow<UInt<Ur, B0>>,
Ur: Unsigned,
<Ul as Pow<UInt<Ur, B0>>>::Output: Unsigned,
<Ul as Pow<UInt<Ur, B0>>>::Output: NonZero,
[src]
Ul: Unsigned + NonZero + Pow<UInt<Ur, B0>>,
Ur: Unsigned,
<Ul as Pow<UInt<Ur, B0>>>::Output: Unsigned,
<Ul as Pow<UInt<Ur, B0>>>::Output: NonZero,
N(Ul)^P(Ur) = P(Ul^Ur) if Ur is even
type Output = PInt<<Ul as Pow<UInt<Ur, B0>>>::Output>
pub fn powi(
self,
PInt<UInt<Ur, B0>>
) -> <NInt<Ul> as Pow<PInt<UInt<Ur, B0>>>>::Output
[src]
self,
PInt<UInt<Ur, B0>>
) -> <NInt<Ul> as Pow<PInt<UInt<Ur, B0>>>>::Output
impl<Ul, Ur> Pow<PInt<UInt<Ur, B1>>> for NInt<Ul> where
Ul: Unsigned + NonZero + Pow<UInt<Ur, B1>>,
Ur: Unsigned,
<Ul as Pow<UInt<Ur, B1>>>::Output: Unsigned,
<Ul as Pow<UInt<Ur, B1>>>::Output: NonZero,
[src]
Ul: Unsigned + NonZero + Pow<UInt<Ur, B1>>,
Ur: Unsigned,
<Ul as Pow<UInt<Ur, B1>>>::Output: Unsigned,
<Ul as Pow<UInt<Ur, B1>>>::Output: NonZero,
N(Ul)^P(Ur) = N(Ul^Ur) if Ur is odd
type Output = NInt<<Ul as Pow<UInt<Ur, B1>>>::Output>
pub fn powi(
self,
PInt<UInt<Ur, B1>>
) -> <NInt<Ul> as Pow<PInt<UInt<Ur, B1>>>>::Output
[src]
self,
PInt<UInt<Ur, B1>>
) -> <NInt<Ul> as Pow<PInt<UInt<Ur, B1>>>>::Output
impl<Ul, Ur> Pow<PInt<Ur>> for PInt<Ul> where
Ul: Unsigned + NonZero + Pow<Ur>,
Ur: Unsigned + NonZero,
<Ul as Pow<Ur>>::Output: Unsigned,
<Ul as Pow<Ur>>::Output: NonZero,
[src]
Ul: Unsigned + NonZero + Pow<Ur>,
Ur: Unsigned + NonZero,
<Ul as Pow<Ur>>::Output: Unsigned,
<Ul as Pow<Ur>>::Output: NonZero,
P(Ul)^P(Ur) = P(Ul^Ur)
type Output = PInt<<Ul as Pow<Ur>>::Output>
pub fn powi(self, PInt<Ur>) -> <PInt<Ul> as Pow<PInt<Ur>>>::Output
[src]
impl<X, N> Pow<N> for X where
N: Unsigned,
X: Unsigned + PrivatePow<UInt<UTerm, B1>, N>,
[src]
N: Unsigned,
X: Unsigned + PrivatePow<UInt<UTerm, B1>, N>,
X^N