List of utility methods to do Float Number Clamp
float | clamp(float f, float min, float max) Keeps f within min and max. return Math.max(min, Math.min(f, max));
|
float | clamp(float input, float min, float max) clamp return (input < min) ? min : (input > max) ? max : input;
|
float | clamp(float min, float max, float val) clamp float _min = Math.min(min, max); float _max = Math.max(min, max); return Math.max(Math.min(val, _max), _min); |
float | clamp(float min, float max, float value) clamp if (min > value) return min; if (max < value) return max; return value; |
float | clamp(float min, float x, float max) Clamps a value between a min and a max, both inclusive. return Math.min(max, Math.max(x, min));
|
float | clamp(float n, float minValue, float maxValue) clamp return max(minValue, min(n, maxValue));
|
float | clamp(float num, float min, float max) Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and third parameters if (num < min) { return min; } else { return num > max ? max : num; |
float | clamp(float v) Clamps the value so the result is between 0.0 and 1.0. return 0 > v ? 0 : 1 < v ? 1 : v;
|
float | clamp(float v, float min, float max) Clamp the given value to the given range. if (min < max) { if (v < min) return min; if (v > max) return max; } else { if (v > min) return min; ... |
float | clamp(float val, float low, float high) Clamps a value between a lower and upper bound. if (val < low) return low; if (val > high) return high; return val; |