---
title: "min(_:_:)"
framework: swift
role: symbol
role_heading: Function
path: "swift/min(_:_:)"
---

# min(_:_:)

Returns the lesser of two comparable values.

## Declaration

```swift
func min<T>(_ x: T, _ y: T) -> T where T : Comparable
```

## Parameters

- `x`: A value to compare.
- `y`: Another value to compare.

## Return Value

Return Value The lesser of x and y. If x is equal to y, returns x.

## See Also

### Choosing the Smallest and Largest Value

- [min(_:_:_:_:)](swift/min(_:_:_:_:).md)
- [max(_:_:)](swift/max(_:_:).md)
- [max(_:_:_:_:)](swift/max(_:_:_:_:).md)
