fold

inline fun <R> fold(initial: R, operation: (acc: R, element: Float) -> R): R(source)

Accumulates values, starting with initial, and applying operation to each element in the FloatList in order.

Parameters

initial

The value of acc for the first call to operation or return value if there are no elements in this list.

operation

function that takes current accumulator value and an element, and calculates the next accumulator value.