average



@PerformancePitfall(message = "Potential boxing access to buffer elements")
fun <T, S : Group<T>, ScaleOperations<T>> S.average(data: Buffer<T>): T(source)
fun <T, S : Group<T>, ScaleOperations<T>> S.average(data: Iterable<T>): T(source)

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

Receiver

the algebra that provides addition and division.

Return

the average value.

Author

Iaroslav Postovalov

Parameters

data

the iterable to find average.


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

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

Receiver

the algebra that provides addition and division.

Return

the average value.

Author

Iaroslav Postovalov

Parameters

data

the sequence to find average.