| Description: | Returns the maximum value of the arguments. | ||
| Class: | Elemental function | ||
| Arguments: | A1, A2, and A3 (opt) must all have the same type (integer or real) and kind parameters. | ||
| Results: | For
MAX0, AMAX1, DMAX1, QMAX1, IMAX0, JMAX0, and
KMAX0, the result type is the same as the arguments. For
MAX1, IMAX1, JMAX1, and KMAX1, the result
type is integer. For AMAX0, AIMAX0, AJMAX0, and
AKMAX0, the result type is real. The value of the result is
that of the largest argument.
The setting of compiler options specifying integer size can affect MAX1. | ||
| Specific Name[1] | Argument Type | Result Type |
|---|---|---|
| INTEGER(1) | INTEGER(1) | |
| INTEGER(1) | REAL(4) | |
| IMAX0 | INTEGER(2) | INTEGER(2) |
| AIMAX0 | INTEGER(2) | REAL(4) |
| MAX0[2] | INTEGER(4) | INTEGER(4) |
| AMAX0[3,4] | INTEGER(4) | REAL(4) |
| KMAX0 | INTEGER(8) | INTEGER(8) |
| AKMAX0 | INTEGER(8) | REAL(4) |
| IMAX1 | REAL(4) | INTEGER(2) |
| MAX1[4,5] | REAL(4) | INTEGER(4) |
| KMAX1 | REAL(4) | INTEGER(8) |
| AMAX1 | REAL(4) | REAL(4) |
| DMAX1 | REAL(8) | REAL(8) |
| QMAX1 | REAL(16) | REAL(16) |
|
[1] These specific functions cannot be passed as actual
arguments.
| ||
Examples
MAX (2.0, -8.0, 6.0) has the value 6.0.
MAX (14, 32, -50) has the value 32.