12.07.2015 Views

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

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.

The data type of the result of an arithmetic expression corresponds to the type of its data. The typeof an expression is determined by the rank of its elements. The following table shows the ranks ofthe various data types, from lowest to highest.Table 2-4: Data Type RanksData TypeLOGICAL1 (lowest)LOGICAL*8 2INTEGER*2 3INTEGER*4 4INTEGER*8 5REAL*4 6REAL*8 (Double precision) 7COMPLEX*8 (Complex) 8COMPLEX*16 (Double complex) 9 (highest)RankThe data type of a value produced by an operation on two arithmetic elements of different datatypes is the data type of the highest-ranked element in the operation. The exception to this rule isthat an operation involving a COMPLEX*8 element and a REAL*8 element produces aCOMPLEX*16 result. In this operation, the COMPLEX*8 element is converted to aCOMPLEX*16 element, which consists of two REAL*8 elements, before the operation isperformed.In most cases, a logical expression will have a LOGICAL*4 result. In cases where the hardwaresupports LOGICAL*8 and if the expression is LOGICAL*8, the result may be LOGICAL*8.2.2 ConstantsA constant is an unchanging value that can be determined at compile time. It takes a formcorresponding to one of the data types. The <strong>PGI</strong> Fortran compilers support decimal (INTEGERand REAL), unsigned binary, octal, hexadecimal, character and Hollerith constants.The use of character constants in a numeric context, for example, in the right-hand side of anarithmetic assignment statement, is supported. These constants assume a data type that conformsto the context in which they appear.2.2.1 Integer ConstantsThe form of a decimal integer constant is:34 Chapter 2

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

Saved successfully!

Ooh no, something went wrong!