min

func min<T : Comparable>(_: T, _: T)

Returns the lesser of two comparable values.

Parameters: x: A value to compare. y: Another value to compare. Returns: The lesser of x and y. If x is equal to y, returns x.

Declaration

func min<T : Comparable>(_ x: T, _ y: T) -> T
func min<T : Comparable>(_: T, _: T, _: T, _: T...)

Returns the least argument passed.

Parameters: x: A value to compare. y: Another value to compare. z: A third value to compare. rest: Zero or more additional values. Returns: The least of all the arguments. If there are multiple equal least arguments, the result is the first one.

Declaration

func min<T : Comparable>(_ x: T, _ y: T, _ z: T, _ rest: T...) -> T