List of utility methods to do Double Number Clamp
double | clamp(double min, double value, double max) Simple utility function which clamps the given value to be strictly between the min and max values. if (value < min) return min; if (value > max) return max; return value; |
double | clamp(double number) clamp if (number > 1) { number = 1; if (number < 0) { number = 0; return number; |
double | clamp(double v, double l, double h) clamps input v to the specified range from l to h return (v < l) ? l : (v > h) ? h : v;
|
double | clamp(double v, double lower, double upper) Clamp the value v to lower and upper. return v < lower ? lower : v > upper ? upper : v;
|
double | clamp(double v, double lower, double upper) Clamps a value to the range [lower, upper]. if (v < lower) return lower; else if (v > upper) return upper; else return v; |
double | clamp(double val) clamp return Math.min(1, Math.max(0, val)); |
double | clamp(double val) Clamps a double between -1 and 1, inclusive. return clamp(1, val); |
double | clamp(double val, double min, double max) Clamps the given value using the specified maximum and minimum. return val < min ? min : val > max ? max : val; |
double | clamp(double val, double min, double max) clamp return Math.max(min, Math.min(max, val)); |
double | clamp(double value) Constraint the provided value to lie within [0..1] range. if (value < 0) { value = 0; if (value > 1) { value = 1; return value; |