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

Create successful ePaper yourself

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

• A constant is always either 32 or 64 bits in size and is typeless. Sign-extension and typeconversionare never performed. All binary operations are performed on 32-bit or 64-bitquantities. This implies that the rules to follow are only concerned with mixing 32-bit and 64-bit data.• When a constant is used with an arithmetic binary operator (including the assignmentoperator) and the other operand is typed, the constant assumes the type and size of the otheroperand.• When a constant is used in a relational expression such as .EQ., its size is chosen from theoperand having the largest size. This implies that 64-bit comparisons are possible.• When a constant is used as an argument to the generic AND, OR, EQV, NEQV, SHIFT, orCOMPL function, a 32-bit operation is performed if no argument is more than 32 bits in size;otherwise, a 64-bit operation is performed. The size of the result corresponds to the chosenoperation.• When a constant is used as an actual argument in any other context, no data type is assumed;however, a length of four bytes is always used. If necessary, truncation on the left occurs.• When a specific 32-bit or 64-bit data type is required, that type is assumed for the constant.Array subscripting is an example.• When a constant is used in a context other than those mentioned above, an INTEGER*4 datatype is assumed. Logical expressions and binary arithmetic operations with other untypedconstants are examples.• When the required data type for a constant implies that the length needed is more than thenumber of digits specified, the leftmost digits have a value of zero. When the required datatype for a constant implies that the length needed is less than the number of digits specified,the constant is truncated on the left. Truncation of nonzero digits is allowed.In the example below, the constant I (of type INTEGER*4) and the constant J (of typeINTEGER*2) will have hex values 1234 and 4567, respectively. The variable D (of type REAL*8)will have the hex value x4000012345678954 after its second assignment:I = '1234'X! Leftmost Pad with zeroJ = '1234567'X! Truncate Leftmost 3 hex digitsD = '40000123456789ab'XD = NEQV(D,'ff'X) ! 64-bit Exclusive OrFortran Data Types 43

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

Saved successfully!

Ooh no, something went wrong!