clamp

fun clamp(number: Int, min: Int, max: Int): Int

Clamps an integer number between two values.

Return

the clamped number

Parameters

number

the number to clamp

min

the minimum

max

the maximum

Sources

Link copied to clipboard