List of utility methods to do Double Number Clamp
double | clamp(double a, double min, double max) clamp return a < min ? min : a > max ? max : a;
|
double | clamp(double d, double min, double max) clamp if (d < min) d = min; if (d > max) d = max; return d; |
double | clamp(double d, double min, double max) clamp if (min > max) throw new IllegalArgumentException("min > max"); if (d >= max) return max; if (d <= min) return min; return d; |
double | clamp(double d, double min, double max) Clamps d between min and max. if (d < min) return min; else if (d > max) return max; else return d; |
double | clamp(double d, double min, double max) Gibt eine Zahl zurueck, die im gegebenen Intervall liegt: [min; max]. return Math.max(Math.min(d, max), min);
|
double | clamp(double f) Returns the given float clamped to 1/1000th precision. return (f > -1e-3) && (f < 1e-3) ? 0 : (f > 1e5 ? 1e5f : (f < -1e5 ? -1e5f : f));
|
double | clamp(double f, double f1, double f2) clamp return f < f1 ? f1 : (f > f2 ? f2 : f);
|
double | clamp(double min, double arg, double max) Clamps arg between min and max. return Math.min(max, Math.max(min, arg));
|
double | clamp(double min, double max, double val) clamp if (val > max) return max; else if (val < min) return min; else return val; |
double | clamp(double min, double max, double value) Constrains the value between the given borders (inclusive). return Math.min(Math.max(min, value), max);
|