24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Functions and Subroutines<br />

Notes:<br />

1. It is also possible to pass intrinsic functions to subprograms. When doing so, only the specific<br />

name of the intrinsic function can be used as an actual argument. The specific name must have<br />

appeared in an INTRINSIC statement.<br />

2. If an intrinsic function has more than one argument, each argument must be of the same type.<br />

3. The generic and specific name of an intrinsic function is the same for some intrinsic functions.<br />

For example, the specific name of the intrinsic function which computes the sine of an argument<br />

whose type is REAL is called SIN which is also the generic name of the sine function.<br />

The following sections present all generic and specific names of intrinsic functions and describe how they<br />

are used. The following is a guide to interpreting the information presented.<br />

Data types are represented by letter codes.<br />

1. CHARACTER is represented by CH.<br />

2. LOGICAL is represented by L.<br />

3. INTEGER is represented by I.<br />

4. INTEGER*1 is represented by I1.<br />

5. INTEGER*2 is represented by I2.<br />

6. REAL (REAL*4) is represented by R.<br />

7. DOUBLE PRECISION (REAL*8) is represented by D.<br />

8. Single precision COMPLEX (COMPLEX*8) is represented by C.<br />

9. Double precision COMPLEX (COMPLEX*16) is represented by Z.<br />

The "Definition" description gives the mathematical definition of the function performed by the intrinsic<br />

function. There are two fields for each intrinsic function. The "Name" field lists the specific and generic<br />

names of the intrinsic functions. When the name of an intrinsic function is a generic name, it is indicated<br />

by the word "generic" in parentheses; all other names are specific names. The "Usage" field describes how<br />

the intrinsic functions are used. "R ←ATAN2(R,R)" is a typical entry in this field. The name of the<br />

intrinsic function always follows the " ←". In this example the name of the intrinsic function is ATAN2.<br />

The data type of the arguments to the intrinsic function are enclosed in parentheses, are separated by<br />

commas, and always follow the name of the intrinsic function. In this case, ATAN2 requires two<br />

arguments both of type REAL. The type of the result of the intrinsic function is indicated by the type<br />

preceding the " ←". In this case, the result of ATAN2 is of type REAL.<br />

<strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> extensions to the <strong>FORTRAN</strong> <strong>77</strong> language are flagged by a dagger (†).<br />

Intrinsic Functions 247

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!