Intrinsic Functions |
6 |
![]() |
Intrinsic functions that are Sun extensions of the ANSI FORTRAN 77 standard are marked with
Intrinsic functions have generic and specific names when they accept arguments of more than one data type. In general, the generic name returns a value with the same data type as its argument. The function may also be called by one of its specific names to handle a specific argument data type.
With functions that work on more than one data item (e.g.
sign(a1,a2)
), all the data arguments must be the same type.In the following tables, the FORTRAN 77 intrinsic functions are listed by:
Note - Compiler options-dbl
,-i2
,-r8
, and-xtypemap
change the default sizes of variables and have an effect on intrinsic references. See the Remarks section on page 333.
Note that REAL*16 and COMPLEX*32 are SPARC and PowerPC only.
Functions
malloc
and free
are not, strictly speaking, intrinsics, they are listed here and in the Sun Fortran Library Reference.
INTEGER
intrinsics that take INTEGER
arguments return vaules of INTEGER
type determined as follows - note that options -i2
, -dbl
, and -xtypemap
may alter the default sizes of actual arguments:
mod sign dim max min and iand or ior xor ieor
-- size of the value returned is the largest of the sizes of the arguments.
abs ishft lshift rshift lrshft ibset btest ivclr ishftc ibits
-- size of the value returned is the size of the first argument.
int epbase epprec malloc
-- size of the value returned is the size of default INTEGER
.
ephuge
-- size of the value returned is the size of the default INTEGER
, or the size of the argument, whichever is largest.
-dbl
and -r8
change the manner that some intrinsics are used. For example, with -dbl
in effect, a call to ZCOS
with a DOUBLE COMPLEX
argument will automatically become a call to CQCOS
because the argument has not been promoted to COMPLEX*32
. The following functions have this capability:
aimag alog amod cabs ccbrt ccos cdabs cdcbrt cdcos cdexp cdlog cdsin cdsqrt cexp clog csin csqrt dabs dacos dacosd dasin dasind datan datand dcbrt dconjg dcos dcosd dcosh ddim derf derfc dexp dimag dint dlog dmod dnint dprod dsign dsin dsind dsinh dsqrt dtan dtand dtanh idnint iidnnt jidnnt zabs zcbrt zcos zexp zlog zsin zsqrt
and iand ieor iiand iieor iior inot ior jiand jieor jior jnot lrshft lshift not or rshift xor
(1) INT
REAL(A) + 0i.
REAL( DBLE(A) ) + i*REAL( DIMAG(A) ).
DBLE(A) + 0i.
VMS FORTRAN takes a similar approach, but makes the specific names available.
1
There must be at least two arguments. 2 The positive difference is: a1-min(a1,a2))
|
Functions Coerced to a Particular Type
Some VMS FORTRAN functions coerce to a particular INTEGER type.
Functions Translated to a Generic Name
In some cases, each VMS-specific name is translated into an f77 generic name.
Zero Extend
The following zero-extend functions are recognized by f77. The first unused high-order bit is set to zero and extended toward the higher-order end to the width indicated in the table