On Fri, Mar 10, 2017 at 4:16 AM, David Sweeris via swift-evolution <
[email protected]> wrote:

>
> I’m ok with doing it as an extension on `Comparable`, although we should
> add an overload for regular ranges, too.
>
> - Dave Sweeris
>

How would the semantics of that work?

Should “16.clamped(to: 0..<10)” produce 9 or 10?

What about “16.clamped(to: 0..<0)”, which is an empty range?

Does “16.0.clamped(to: 0..<10)” yield 10.0 or the next-smaller
representable Double?

 Nevin
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to