clamp<T extends num> static method
T
clamp<T extends num>(
- T n,
- T min,
- T max
Returns n
bounded into the inclusive range min
to max
.
Implementation
static T clamp<T extends num>(T n, T min, T max) =>
n < min ? min : (n > max ? max : n);