---
title: "simd_clamp(_:_:_:)"
framework: simd
role: symbol
role_heading: Function
path: "simd/simd_clamp(_:_:_:)-7ck0a"
---

# simd_clamp(_:_:_:)

## Declaration

```swift
func simd_clamp(_ x: simd_half16, _ min: simd_half16, _ max: simd_half16) -> simd_half16
```

## Discussion

Discussion X clamped to the range [min, max]. Note that if you want to clamp all lanes to the same range, you can use a scalar value for min and max.
