10.07.2015 Views

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

Language OverviewTable 5 Arithmetic OperatorsOperatorFunction** Exponentiation* Multiplication/ Division+ Addition or unary plus- Subtraction or unary minusArithmetic Operator PrecedenceArithmetic expressions are evaluated in an order determined by a precedence associated witheach operator. Table 6 shows the precedence of each arithmetic operator.Table 6 Arithmetic Operator PrecedenceOperatorPrecedence** First* and / Second+ and - ThirdThis following example is resolved into the arithmetic expressions (A) + (B * C) rather than (A +B) * (C).A + B * CNormal ranked precedence may be overcome using parentheses which force the item(s) enclosedto be evaluated first. For example, in the following expression the computer firsts adds A and B,and then multiplies that sum by C.(A + B) * CArithmetic Expression Types<strong>The</strong> type of an arithmetic expression depends on the type of elements in the expression:INTEGERif it contains only integer elements.REALif it contains only real and integer elements.DOUBLE PRECISIONif it contains only double precision, real and integer elements.<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 10

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

Saved successfully!

Ooh no, something went wrong!