average

fun <T, S : Ring<T>, ScaleOperations<T>> S.average(data: Iterable<T>): T

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

Return

the average value.

Author

Iaroslav Postovalov

Parameters

<receiver>

the algebra that provides addition and division.

data

the iterable to find average.

fun <T, S : Ring<T>, ScaleOperations<T>> S.average(data: Sequence<T>): T

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

Return

the average value.

Author

Iaroslav Postovalov

Parameters

<receiver>

the algebra that provides addition and division.

data

the sequence to find average.