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

doubleclipNormalized(double a)
clip Normalized
if (a < 0) {
    return 0;
} else if (a > 1) {
    return 1;
return a;
booleanclipRange(double[] x, double minVal, double maxVal)
Adjust values in x so that all values smaller than minVal are set to minVal, and all values greater than maxVal are set to maxVal
boolean modified = false;
if (x == null) {
    return modified;
for (int i = 0; i < x.length; i++) {
    if (x[i] < minVal) {
        x[i] = minVal;
        modified = true;
...
doubleclipRecklessly(double val, double bounds)
Clips the given value within the given bounds.
if (val > bounds) {
    return bounds;
} else if (val < -bounds) {
    return -bounds;
} else {
    return val;