clamp

fun clamp(n: Double, min: Double, max: Double): Double

Ensures that n lies in the range min..max.