List of utility methods to do Double Number Clip
double | clip(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; |
double | clip(double value, double min, double max) clip if (value > max) value = max; if (value < min) value = min; return value; |
double | clip(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; |
double | clip(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);
|
double | clip(final double value, final double min, final double max) clip return value > max ? max : (value < min ? min : value);
|
boolean | clip2(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 { ... |
double | clipDecimals(double num, int n) clip Decimals long m = (long) Math.pow(10, n); long aux = Math.round(num * m); return (double) aux / (double) m; |
double | clipDouble(double value, double max) clip Double return clipDouble(value, 0, max);
|
double | clipnorm(double d, double min, double max) clipnorm if (d < min) return (0.0); if (d > max) return (1.0); return ((d - min) / (max - min)); |