跳到主內容

//ERDDAP/com.cohort.util/ScriptMath2/minMaxDef

minMaxDef

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

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

Return

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

Parameters

JVM

minthe minimum allowed value
maxthe maximum allowed value
defthe default value
currentthe current value

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

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

Return

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

Parameters

JVM

minthe minimum allowed value
maxthe maximum allowed value
defthe default value
currentthe current value