Function num::traits::clamp [−][src]
pub fn clamp<T>(input: T, min: T, max: T) -> T where
T: PartialOrd<T>,
A value bounded by a minimum and a maximum
If input is less than min then this returns min. If input is greater than max then this returns max. Otherwise this returns input.
Panics in debug mode if !(min <= max)
.