Generic and Specific Function Names [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Reference
Generic and Specific Function Names
Each of the intrinsic functions has a generic name, one or more specific
names, or both generic and specific names. A generic name can be used
with any of the valid data types for the function. A specific name can
be used with only the specified data type. If both a generic and a
specific name exist, either can be used to invoke the function. However,
generic names are recommended because they are more flexible.
For example, the generic function COS(arg) can have an argument of type
REAL*4, REAL*8, REAL*16, COMPLEX*8, or COMPLEX*16. The data type of the
result will be the same as that of the argument.
The specific function DCOS(arg) takes a REAL*8 argument. Any other data
type is invalid. The data type of the result is REAL*8. Similarly, the
specific function CCOS(arg) can take only a COMPLEX*8 argument.
If a function (such as MOD) requires more than one argument, all
arguments to that function must be the same general data type. For
example, INTEGER*2 arguments can be mixed with INTEGER*4 arguments, but
integer and real arguments cannot be mixed.
Note, however, that if mixed types are used, INTEGER*2 arguments will be
sign-extended when promoted to INTEGER*4 arguments.
If a subroutine (such as MVBITS) requires more than one argument, all
arguments to that subroutine must be the same data type. For example,
INTEGER*2 arguments cannot be mixed with INTEGER*4 arguments.
If a generic or specific name appears as a formal argument, that name
does not identify an intrinsic function in that program unit or statement
function. For example, in this subroutine
SUBROUTINE sub(log,f)
.
.
.
f = log(f)
END
log is not an intrinsic function.
MPE/iX 5.0 Documentation