[swift-evolution] [Idea] Add `bounds` function to standard library

Georgios Moschovitis george.moschovitis at icloud.com
Thu Aug 25 06:13:22 CDT 2016

> In the standard library there is a `min` and a `max` function but there isn't
> a `bounds` function, or a function that takes a value and an upper and lower bound and returns that value if it is 

Perhaps ‘clamp’ would be a better name?

More information about the swift-evolution mailing list