clip<T extends num> function
T
clip<T extends num>(
- T val,
- T lower,
- T upper
Implementation
T clip<T extends num>(T val, T lower, T upper) {
return min(upper, max(val, lower));
}