FORTRAN Reference Manual

FORTRAN Reference Manual528615-001
8-1
8 Intrinsic Functions
Intrinsic functions are compiler-defined procedures that return a single value. Topics
covered in this section include:
Table 8-1 on page 8-2 summarizes the FORTRAN intrinsic functions described in this
section.
The general form of an intrinsic function reference is:
function-name ( argument-list )
function-name is the generic or specific name of a FORTRAN intrinsic function.
argument-list consists of one or more expressions separated by commas. Each
argument you supply must correspond to the type required by function-name.
Declaring Intrinsic Functions
FORTRAN defines the type returned by each intrinsic function. If your program
includes a type declaration that specifies the name of an intrinsic function, the intrinsic
function’s name retains its meaning only if the type you specify is the same as the type
of the intrinsic defined in the FORTRAN environment.
If your type declaration specifies a type other than the intrinsic function’s type, or if you
use the name of an intrinsic function as the name of a variable, array, RECORD,
dummy argument, subprogram, or statement function in your program, the intrinsic
function’s name takes on the meaning you define. Within that program unit, you cannot
reference the intrinsic.
If you refer to an external function with the same name as an intrinsic function name,
you must declare the external function in an EXTERNAL statement. For additional
information, see Section 7, Statements.
If you pass an intrinsic function name as an argument in a CALL statement or external
function reference, and that intrinsic function name has not appeared as a referenced
function anywhere in the same program unit, FORTRAN assumes the name is a
variable rather than an intrinsic function, unless you declare the name as the name of
an intrinsic function in an INTRINSIC statement described in Section 7, Statements.
Topic Page
Declaring Intrinsic Functions
8-1
Referencing an Intrinsic Function 8-2
Using Generic and Specific Function Names 8-3