List of utility methods to do Double Number Clamp
double | clamp(double value) Clamps a given value to be an element of [0..1]. if (value > 1.0) return 1.0; if (value < 0.0) return 0.0; return value; |
double | clamp(double value, double low, double high) clamp if (value < low) { return low; if (value > high) { return high; return value; |
double | clamp(double value, double low, double high) Clamp a value to be within the provided range. return Math.min(Math.max(value, low), high);
|
double | clamp(double value, double low, double high) clamp return Math.min(Math.max(value, low), high);
|
double | clamp(double value, double min, double max) clamp return (value < min ? min : (value > max ? max : value));
|
double | clamp(double value, double min, double max) clamp return Math.max(Math.min(value, max), min);
|
double | clamp(double value, double min, double max) Clamp a value to the given range return Math.max(min, Math.min(max, value));
|
double | clamp(double value, double min, double max) Clamp the given value in the range [min, max]. return (value > max) ? max : ((value < min) ? min : value);
|
double | clamp(double value, final double min, final double max) Make sure a value is in between the specified bounds. if (value < min) { value = min; } else if (value > max) { value = max; return value; |
double | clamp(double var1, double var2, double var3) clamp if (var1 > var3) { var1 = var3; if (var1 < var2) { var1 = var2; return var1; |