[Docs] Samples for 'step' function

This commit is contained in:
Alex Kuznetsov
2023-08-25 04:57:05 +02:00
committed by Space Team
parent 53645bce2b
commit 35b3a9ec82
4 changed files with 51 additions and 0 deletions
@@ -961,6 +961,8 @@ public fun CharProgression.reversed(): CharProgression {
/**
* Returns a progression that goes over the same range with the given step.
*
* @sample samples.ranges.Ranges.stepInt
*/
public infix fun IntProgression.step(step: Int): IntProgression {
checkStepIsPositive(step > 0, step)
@@ -969,6 +971,8 @@ public infix fun IntProgression.step(step: Int): IntProgression {
/**
* Returns a progression that goes over the same range with the given step.
*
* @sample samples.ranges.Ranges.stepLong
*/
public infix fun LongProgression.step(step: Long): LongProgression {
checkStepIsPositive(step > 0, step)
@@ -977,6 +981,8 @@ public infix fun LongProgression.step(step: Long): LongProgression {
/**
* Returns a progression that goes over the same range with the given step.
*
* @sample samples.ranges.Ranges.stepChar
*/
public infix fun CharProgression.step(step: Int): CharProgression {
checkStepIsPositive(step > 0, step)
@@ -345,6 +345,8 @@ public fun ULongProgression.reversed(): ULongProgression {
/**
* Returns a progression that goes over the same range with the given step.
*
* @sample samples.ranges.Ranges.stepUInt
*/
@SinceKotlin("1.5")
@WasExperimental(ExperimentalUnsignedTypes::class)
@@ -355,6 +357,8 @@ public infix fun UIntProgression.step(step: Int): UIntProgression {
/**
* Returns a progression that goes over the same range with the given step.
*
* @sample samples.ranges.Ranges.stepULong
*/
@SinceKotlin("1.5")
@WasExperimental(ExperimentalUnsignedTypes::class)