# Revisiting SE-0177: Adding \`clamped(to:)\`

**URL:** <https://forums.swift.org/t/revisiting-se-0177-adding-clamped-to/38332>\
**Category:** Pitches\
**Created:** [July 9, 2020, 4:49pm UTC](https://forums.swift.org/t/revisiting-se-0177-adding-clamped-to/38332 "2020-07-09T16:49:19Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![benrimmington](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/benrimmington/32/695_2.png) [@benrimmington](https://forums.swift.org/u/benrimmington)\
**Post date:** [August 4, 2021, 4:45pm UTC](https://forums.swift.org/t/revisiting-se-0177-adding-clamped-to/38332/17 "2021-08-04T16:45:19Z")

</div>

- The [original discussion](https://forums.swift.org/t/add-a-clamp-function-to-algorithm-swift/5405/46) also had support for a `median` free function.

- Could the new protocol be improved, to become the primary API?  
(i.e. The generic `clamped(to:)` method would be removed completely,  
but a generic `@Clamped(to:)` property wrapper could be proposed later.)

- Should the `clamped(to:)` method be on [`Strideable`](https://developer.apple.com/documentation/swift/strideable) instead?  
(`Foundation.Date` has all the requirements of `Strideable`,  
but it doesn't conform yet: FB9452917.)

---

_[View the full topic](https://forums.swift.org/t/revisiting-se-0177-adding-clamped-to/38332)._
