num.clamp
Extacted from #130101, dropped the `@_debugAssert` stuff from that PR so it's easier to review.