Java Utililty Methods Double Number Clip

List of utility methods to do Double Number Clip

Description

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

Method

doubleclip(double v, double min, double max)
Limits the range of v to be between min and max.
if (v < min)
    return min;
if (v > max)
    return max;
return v;
doubleclip(double value, double min, double max)
clip
if (value > max)
    value = max;
if (value < min)
    value = min;
return value;
doubleclip(double value, double min, double max)
clip
if (value > max)
    value = max;
else if (value < min)
    value = min;
return value;
double[]clip(double[] values, double min, double max)
Ensures that each entry in the specified array has a min value equal to or greater than the specified min and a maximum value less than or equal to the specified max.
for (int i = 0; i < values.length; i++) {
    values[i] = Math.min(1, Math.max(0, values[i]));
return values;
doubleclip(final double n, final double minValue, final double maxValue)
Clips a number to the specified minimum and maximum values.
return Math.min(Math.max(n, minValue), maxValue);
doubleclip(final double value, final double min, final double max)
clip
return value > max ? max : (value < min ? min : value);
booleanclip2(double n, double d, double[] t)
clip
if (d == 0) {
    return n <= 0;
double v = n / d;
if (d > 0) {
    if (v > t[1])
        return false;
} else {
...
doubleclipDecimals(double num, int n)
clip Decimals
long m = (long) Math.pow(10, n);
long aux = Math.round(num * m);
return (double) aux / (double) m;
doubleclipDouble(double value, double max)
clip Double
return clipDouble(value, 0, max);
doubleclipnorm(double d, double min, double max)
clipnorm
if (d < min)
    return (0.0);
if (d > max)
    return (1.0);
return ((d - min) / (max - min));