Overslaan en naar de inhoud gaan

//ERDDAP/com.cohort.util/ScriptMath2/minMax

minMax

[JVM]
fun minMax(min: Int, max: Int, current: Int): Int

This forces a int into a range defined by min..max.

Return

min if current is less than min; or max if current is greater than max; else it returns the current value.

Parameters

JVM

minthe minimum allowed value
maxthe maximum allowed value
currentthe current value

[JVM]
fun minMax(min: Double, max: Double, current: Double): Double

This forces a double into a range defined by min..max.

Return

min if current is less than min; or max if current is greater than max; else it returns the current value.

Parameters

JVM

minthe minimum allowed value
maxthe maximum allowed value
currentthe current value