clamp method
T
clamp(
- T low,
- T high
Clamps this Comparable to be within the range [low, high].
Implementation
T clamp(T low, T high) =>
(this < low) ? low : ((this > high) ? high : (this as T));
Clamps this Comparable to be within the range [low, high].
T clamp(T low, T high) =>
(this < low) ? low : ((this > high) ? high : (this as T));