step

fun Number.step(to: Number, lambda: (Number) -> Unit)

evaluates the supplied lambda block with the cursor starting at the receiver number, until it reaches the ending number. The step size defaults to 1.

Parameters

<receiver>

Number

to

the ending number

lambda

the lambda expression to execute until reaching the ending number

inline fun Number.step(to: Number, step: Number, lambda: (Number) -> Unit)

evaluates the supplied lambda block with the cursor starting at the receiver number, until it reaches the ending number.

Parameters

<receiver>

Number

to

the ending number

step

the step size

lambda

the lambda expression to execute until reaching the ending number

Throws