List of utility methods to do Double Number Clamp
short | clampRoundShort(double in) Clamps and rounds a number to the range supported by short data type. return (in > Short.MAX_VALUE ? Short.MAX_VALUE : (in >= Short.MIN_VALUE ? (short) Math.floor(in + 0.5) : Short.MIN_VALUE)); |
double | clampToPercentageOrNAN(double input) clamp To Percentage Or NAN if (Double.isNaN(input)) { return Double.NaN; } else if (input < 0.0) { return 0.0; } else if (input > ONE_HUNDRED_PERCENT_CPU_VALUE) { return ONE_HUNDRED_PERCENT_CPU_VALUE; } else { return input; ... |
double | clampVector(double d) clamp Vector return d < 0 ? 0 : (d > 1 ? 1 : d);
|