pub fn pow_with_uint<T: NumCast + One + Zero + Div<T, T> + Mul<T, T>>(radix: uint, pow: uint) -> T
Calculates a power to a given radix, optimized for uint pow
and radix
.
Returns radix^pow
as T
.
Note:
Also returns 1
for 0^0
, despite that technically being an
undefined number. The reason for this is twofold:
- If code written to use this function cares about that special case, it's
probably going to catch it before making the call.
- If code written to use this function doesn't care about it, it's
probably assuming that x^0
always equals 1
.
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).