Negative step for progression in doc

Hi,
In progression doc there is a comment about negative step :

The last element of the progression is calculated this way:

  • For a positive step: the maximum value not greater than the end value such that (last - first) % step == 0.
  • For a negative step: the minimum value not less than the end value such that (last - first) % step == 0.

Can you give an example for negative step in doc?

I have done this :
(10 downTo 2 step 3).toList()
but is it a negative step?

When a progression is constructed with downTo function, it gets a negative step, you can check that by examining its step property.

fun main() {
//sampleStart
println((10 downTo 2 step 3).step)
//sampleEnd
}

You specify the magnitude of that step with the step infix function, that’s why it is specified without a sign.

1 Like

Thanks
I think my problem is with english (I’m french)
In french I will write that
step is add
or substract when downTo is used