fn clamp

Clamps x into the inclusive range [lo, hi]. Equivalent to max(lo, min(hi, x)).