Java Utililty Methods Double Number Clamp

List of utility methods to do Double Number Clamp

Description

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

Method

doubleclamp(double value)
Clamps a given value to be an element of [0..1].
if (value > 1.0)
    return 1.0;
if (value < 0.0)
    return 0.0;
return value;
doubleclamp(double value, double low, double high)
clamp
if (value < low) {
    return low;
if (value > high) {
    return high;
return value;
doubleclamp(double value, double low, double high)
Clamp a value to be within the provided range.
return Math.min(Math.max(value, low), high);
doubleclamp(double value, double low, double high)
clamp
return Math.min(Math.max(value, low), high);
doubleclamp(double value, double min, double max)
clamp
return (value < min ? min : (value > max ? max : value));
doubleclamp(double value, double min, double max)
clamp
return Math.max(Math.min(value, max), min);
doubleclamp(double value, double min, double max)
Clamp a value to the given range
return Math.max(min, Math.min(max, value));
doubleclamp(double value, double min, double max)
Clamp the given value in the range [min, max].
return (value > max) ? max : ((value < min) ? min : value);
doubleclamp(double value, final double min, final double max)
Make sure a value is in between the specified bounds.
if (value < min) {
    value = min;
} else if (value > max) {
    value = max;
return value;
doubleclamp(double var1, double var2, double var3)
clamp
if (var1 > var3) {
    var1 = var3;
if (var1 < var2) {
    var1 = var2;
return var1;