List of utility methods to do Int Clamp
int | clamp(int x, int a, int b) clamp return (x < a) ? a : (x > b) ? b : x;
|
int | clamp(int x, int min, int max) clamp if (x > max) return max; if (x < min) return min; return x; |
int | clamp(int x, int a, int b) clamp return (x < a) ? a : (x > b) ? b : x;
|