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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

8 Assignment Statements<br />

8.1 Introduction<br />

Assignment statements are used to define entities. There are four different types of assignment.<br />

1. Arithmetic<br />

2. Logical<br />

3. Statement label (ASSIGN)<br />

4. Character<br />

8.2 Arithmetic Assignment<br />

The form of an arithmetic assignment statement is<br />

<br />

v = e<br />

where:<br />

v<br />

e<br />

is a variable name or array element name of type INTEGER, REAL, DOUBLE PRECISION,<br />

COMPLEX or double precision complex (COMPLEX*16).<br />

is an arithmetic expression.<br />

The following are examples of arithmetic assignment statements.<br />

Y = X**2 + 4.0*X + 3.0<br />

Z(10) = 4.3*(X+Y)<br />

Executing an arithmetic assignment statement causes the evaluation of the arithmetic expression e,<br />

converting the type of the expression e to the type of v, and defining v with the result.<br />

If v is of type INTEGER*1 or INTEGER*2, then the value of the expression e is first converted to type<br />

INTEGER. The resulting integer is then assigned to v in the following way.<br />

1. If v is of type INTEGER*2 and the value of e is such that −32768

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

Saved successfully!

Ooh no, something went wrong!