List of utility methods to do Double Number Clip
double | clipNormalized(double a) clip Normalized if (a < 0) { return 0; } else if (a > 1) { return 1; return a; |
boolean | clipRange(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; ... |
double | clipRecklessly(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; |