spow

T
spow
pure nothrow @nogc
(
T
)
(
in T val
,
size_t k
)
if (
is(typeof(T.init / T.init) == T) &&
is(typeof(T.init * T.init) == T)
)

Examples

1 import des.math.linear.vector;
2 assert( spow( vec3( 1, 2, 3 ), 3 ) == vec3( 1, 8, 27 ) );
3 assert( spow( 10, 0 ) == 1 );
4 assert( spow( 10, 1 ) == 10 );
5 assert( spow( 10, 2 ) == 100 );
6 assert( spow( 10, 3 ) == 1000 );
7 assert( spow( 10, 4 ) == 10000 );

Meta