# min

min(x, y, ...)

Return the minimum of the arguments. Operates elementwise over arrays.

## Examples

``````julia> x = rand(5)
y = rand(5)
min(x,y)
5-element Array{Float64,1}:
0.470566
0.0918323
0.106548
0.28768
0.0033303``````
1. Find the minimum value of two numbers:

``````julia> min(5, 3)
3``````

This example returns the minimum value between 5 and 3.

2. Find the minimum value among multiple numbers:

``````julia> min(10, 7, 15, 4)
4``````

It calculates the minimum value among the provided numbers.

3. Find the minimum value in an array:

``````julia> arr = [5, 3, 9, 1, 7];
julia> min(arr...)
1``````

This example uses the splat operator `...` to pass the array as separate arguments to the `min` function.

4. Find the minimum value elementwise between arrays:
``````julia> arr1 = [2, 4, 6];
julia> arr2 = [1, 5, 3];
julia> min(arr1, arr2)
3-element Array{Int64,1}:
1
4
3``````

It calculates the elementwise minimum between the corresponding elements of `arr1` and `arr2`.

Common mistake example:

``````julia> min([5, 2, 7])
ERROR: MethodError: no method matching min(::Array{Int64,1})``````

In this example, the mistake is passing an array directly to the `min` function instead of using the splat operator `...`. The correct approach is to use `min(arr...)` to calculate the minimum value among the elements of the array.