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