Function clamp

fn clamp<T: PartialOrd>(input: T, min: T, max: T) -> T