List of utility methods to do Float Number Clamp
float | clamp(float val, float max, float min) clamp return val > max ? max : val < min ? min : val; |
float | clamp(float val, float min, float max) Clamps the given value between the min and max values if (val < min) return min; if (val > max) return max; return val; |
float | clamp(float val, float min, float max) Clamp a value between min and max bounds. return Math.max(min, Math.min(max, val)); |
float | Clamp(float val, float minVal, float maxVal) Clamp return (Min(Max(minVal, val), maxVal)); |
float | clamp(float value) clamp return clamp(value, 0f, 1f);
|
float | Clamp(float value, float lowerLimit, float upperLimit) Clamp assert (lowerLimit <= upperLimit); return Math.min(Math.max(value, lowerLimit), upperLimit); |
float | clamp(float value, float min, float max) clamp return value < min ? min : value > max ? max : value;
|
float | clamp(float value, float min, float max) Clamps a float return value < min ? min : value > max ? max : value;
|
float | clamp(float value, float min, float max) clamp if (value < min) return min; if (value > max) return max; return value; |
float | clamp(float value, float min, float max) clamp if (max < min) return value; if (value < min) value = min; else if (value > max) value = max; return value; |