Pasar al contenido principal

//ERDDAP/com.cohort.util/ScriptMath2/smallerDouble

smallerDouble

[JVM]
open fun smallerDouble(def: Double, mult: Double, min: Double, d: Double): Double

This decreases d to the previous multiple of mult.

Return

the next multiple of mult smaller than d. It rounds to nearest mult, then changes it. If !Double.isFinite(d), it returns def.

Parameters

JVM

defthe default value
multthe multiple
minthe minimum value
dthe initial value