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.

7 Expressions<br />

The following topics are discussed in this chapter.<br />

• Arithmetic Expressions<br />

• Character Expressions<br />

• Relational Expressions<br />

• Logical Expressions<br />

• Evaluating Expressions<br />

• Constant Expressions<br />

7.1 Arithmetic Expressions<br />

Arithmetic expressions are used to describe computations involving operands with numeric data type,<br />

arithmetic operators and left and right parentheses. The result of the computation is of numeric data type.<br />

7.1.1 Arithmetic Operators<br />

The following table lists the arithmetic operators and the operation they perform.<br />

<br />

Operator<br />

Arithmetic Operation<br />

** Exponentiation<br />

/ Division<br />

* Multiplication<br />

- Subtraction or Negation<br />

+ Addition or Identity<br />

Some operators can be either binary or unary. A binary operator is one that requires two operands. A<br />

unary operator is one that requires one operand. Each of the operators **, /, and * are binary operators.<br />

The operators + and − can either be binary or unary operators. The following table describes how each<br />

operator is used with their operands.<br />

Arithmetic Expressions 173

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

Saved successfully!

Ooh no, something went wrong!