next up previous contents
Next: Logical KIND SelectionReturn to Up: Parameterised Intrinsic Types Previous: Kind Functions

 

Expression Evaluation

If the two operands of any intrinsic operation have the same type and kind, then the result also has this type and kind. If the kinds are different, then the operand with the lower range is promoted before the operation is performed.

For example, with the following declarations

    INTEGER(short) :: members, attendees
    INTEGER(long)  :: salaries, costs

the expression:

Care must be taken to ensure the LHS is able to hold numbers returned by the RHS.

The rules for normal type coercion still hold, in mixed type expressions INTEGER s are promoted to REAL s, REAL s to DOUBLE PRECISION and so on.

Return to corresponding overview page gif


next up previous contents
Next: Logical KIND SelectionReturn to Up: Parameterised Intrinsic Types Previous: Kind Functions

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.