Max

Function Type:

Max is a function that will work on either INTEGER or REAL arguments.

Function Purpose:

The max function will return the maximum value of all the arguments passed to it. Please take note that the max function can have ( in theory ) an unlimited number of arguments passed to it.

Required Arguments:

max ( A1,A2,A3,..... )

The argument A1 can either be an INTEGER argument or a REAL argument.

A2, A3 and however many other arguments that get passed to the function all must be of the same type as A1.

Optional Arguments:

There are no optional arguments to this function.

Results:

The following variables (except x5 which will be the variable the function outputs to ) are going to get passed to the max function:
		x1 = 6.6
		x2 = -19.6
		x3 = 289.5
		x4 = -92.0
		x5 = 0.0
		x5 = max(x1,x2,x3,x4)
Naturally, the value of 289.5 is stored in x5.

Please note that integers or floating point numbers can also be passed to this function. For example:
		x5 = max(5.4,-99.8,-1234.5)
will have the result of storing the value of 5.4 in x5.

Special Note:

The max function is actually a generic name for a group of Fortran intrinsic functions. There are specific function names like AMAX0 ( for integer values ) and AMAX1 ( for real values ). Please see lecture seven for more information.

For additional information and examples see:

Lecture seven

Examples: array1.f, debug.f, charvar.f

Up one level / Home


Written by Jason Wehr : jcw142@psu.edu and Maintained by John Mahaffy : jhm@cac.psu.edu