averageWith

fun <T, S : Ring<T>, ScaleOperations<T>> Iterable<T>.averageWith(space: S): T

Returns an average value of elements in the iterable in this Ring.

Return

the average value.

Author

Iaroslav Postovalov

Parameters

<receiver>

the iterable to find average.

space

the algebra that provides addition and division.

fun <T, S : Ring<T>, ScaleOperations<T>> Sequence<T>.averageWith(space: S): T

Returns an average value of elements in the sequence in this Ring.

Return

the average value.

Author

Iaroslav Postovalov

Parameters

<receiver>

the sequence to find average.

space

the algebra that provides addition and division.