Java Utililty Methods Float Number Clamp

List of utility methods to do Float Number Clamp

Description

The list of methods to do Float Number Clamp are organized into topic(s).

Method

floatclamp(float val, float max, float min)
clamp
return val > max ? max : val < min ? min : val;
floatclamp(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;
floatclamp(float val, float min, float max)
Clamp a value between min and max bounds.
return Math.max(min, Math.min(max, val));
floatClamp(float val, float minVal, float maxVal)
Clamp
return (Min(Max(minVal, val), maxVal));
floatclamp(float value)
clamp
return clamp(value, 0f, 1f);
floatClamp(float value, float lowerLimit, float upperLimit)
Clamp
assert (lowerLimit <= upperLimit);
return Math.min(Math.max(value, lowerLimit), upperLimit);
floatclamp(float value, float min, float max)
clamp
return value < min ? min : value > max ? max : value;
floatclamp(float value, float min, float max)
Clamps a float
return value < min ? min : value > max ? max : value;
floatclamp(float value, float min, float max)
clamp
if (value < min)
    return min;
if (value > max)
    return max;
return value;
floatclamp(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;