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...

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

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

Language OverviewOperatorUnary + or -Binary + or –Relational operators: GT., .GE., .LE.Relational operators ==, /=Relational operators =Relational operators .EQ., .NE., .LT..NOT..AND..OR..NEQV. and .EQV.Binary definedEvaluatedN/AN/AN/ASame precedenceSame precedenceSame precedenceN/AN/AN/AN/ALowestFor example, the following two expressions are equivalent. If we set A to 16, B to 4, and C to 2,both expressions equal 8.A/B*C such as 16 / 4 * 2(A/B)*C such as (16 /4) * 2Another example of equivalent expressions are these:A*B+B**C .EQ. X+Y/Z .AND. .NOT. K-3.0 .GT. T((((A*B)+(B**C)) .EQ. (X+(Y/Z))) .AND. (.NOT. ((K-3.0) .GT. T)))1.7.3. Arithmetic ExpressionsArithmetic expressions are formed from arithmetic elements and arithmetic operators.Arithmetic ElementsAn arithmetic element may be:‣ an arithmetic expression‣ a variable‣ a constant‣ an array element‣ a function reference‣ a field of a structureA value should be associated with a variable or array element before it is used in an expression.Arithmetic Operators<strong>The</strong> arithmetic operators specify a computation to be performed on the elements. <strong>The</strong> result is anumeric result. Table 5 shows the arithmetic operators.<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 9

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

Saved successfully!

Ooh no, something went wrong!