rawMoment

T
rawMoment
pure nothrow @property @nogc
(
T
)
(
in T[] arr
,
size_t k = 1
)
if (
is(typeof(T.init + T.init) == T) &&
is(typeof(T.init * T.init) == T)
&&
is(typeof(T.init / T.init) == T)
&&
is(typeof(T.init / 1UL) == T)
)
in { assert (arr.length > 0); }

Examples

auto a = [ 1.0f, 2 ];
assert( a.rawMoment == 1.5 );
assert( a.rawMoment(2) == 2.5 );

Meta