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.

<strong>Language</strong> <strong>Reference</strong><br />

7.1.3 Arithmetic Constant Expression<br />

An arithmetic constant expression is an arithmetic expression in which all primaries are one of the<br />

following.<br />

1. arithmetic constant<br />

2. symbolic arithmetic constant<br />

3. ( arithmetic constant expression )<br />

There is a further restriction with the exponentiation operator; the exponent must be of type INTEGER.<br />

As an extension to the <strong>FORTRAN</strong> <strong>77</strong> language, <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> supports the use of the<br />

intrinsic function ISIZEOF in an arithmetic constant expression.<br />

Example:<br />

PARAMETER (INTSIZ = ISIZEOF(INTEGER))<br />

An integer constant expression is an arithmetic constant expression in which all constants and symbolic<br />

constants are of type INTEGER.<br />

Example:<br />

123<br />

-753+2<br />

-(12*13)<br />

A real constant expression is an arithmetic constant expression in which at least one constant or symbolic<br />

constant is of type REAL and all other constants or symbolic constants are of type REAL or INTEGER.<br />

Example:<br />

123.<br />

-753+2.0<br />

-(13E0*12)<br />

A double precision constant expression is an arithmetic constant expression in which at least one constant<br />

or symbolic constant is of type DOUBLE PRECISION and all other constants or symbolic constants are of<br />

type DOUBLE PRECISION, REAL or INTEGER.<br />

Example:<br />

123.4D0<br />

-753D0*2+.5<br />

-(12D0*12.2)<br />

A complex constant expression is an arithmetic constant expression in which at least one constant or<br />

symbolic constant is of type COMPLEX and all other constants or symbolic constants are of type<br />

COMPLEX, REAL or INTEGER.<br />

176 Arithmetic Expressions

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

Saved successfully!

Ooh no, something went wrong!