Lahey/Fujitsu Fortran

MIN Function


The MIN function returns the minimum value from a list of INTEGER or REAL arguments.


MIN (a1, a2 [, a3, ...])


The arguments are INTENT(IN) scalars or arrays of type INTEGER or REAL. They must all be of the same type and kind.

If more than one argument is an array, all arrays must have the same shape.


The result is of the same type and kind as the arguments.

If all the arguments are scalar, the result is the value of the smallest argument.

If any of the arguments are arrays, the result is an array with the same shape. Each element of the result is as if the scalar MIN function was called for each corresponding element of the array argument(s).


integer :: i6(6)=(/-14,3,0,-2,19,1/) write(*,*) min(i6,0) ! writes -14 0 0 -2 0 0 write(*,*) min(-14,3,0,-2,19,1) ! writes -14