List of utility methods to do Float Number Clamp
float | clamp(final float min, final float x, final float max) Clamps the input x between min and max return Math.max(min, Math.min(x, max));
|
float | clamp(final float num, final float bound1, final float bound2) clamp final float max = Math.max(bound1, bound2), min = Math.min(bound1, bound2); return Math.max(Math.min(num, max), min); |
float | clamp(final float v, final float min, final float max) clamp if (v < min) return min; else if (v > max) return max; else return v; |
float | clamp(final float val, final float min, final float max) With this function you can maintain an input value between a specified range. return Math.max(min, Math.min(max, val)); |
float | clamp(final float value, final float min, final float max) Constrains a value between a min and a max return (value < min) ? min : ((value > max) ? max : value);
|
float | clamp(final float x, final float a, final float b) clamp return x < a ? a : x > b ? b : x;
|
float | Clamp(float a, float min, float max) Clamp if (a < min) { return min; } else if (a > max) { return max; } else { return a; |
float | clamp(float a, float min, float max) clamp return a < min ? min : (a > max ? max : a);
|
float | clamp(float f) Clamp the given value to [0, 1] f = f < 0.0f ? 0.0f : f;
f = f > 1.0f ? 1.0f : f;
return f;
|
float | clamp(float f, float min, float max) Rounds the given value so that it's bigger or equal to min and smaller or equal to max. float r = f; if (r < min) r = min; if (r > max) r = max; return r; |