DIM(X, Y)

Purpose

The difference X-Y if it is positive; otherwise zero.

Class

Elemental function

Argument type and attributes

X
An INTENT(IN) INTEGER or REAL
Y
An INTENT(IN) argument of the same type and kind type parameter as X.

Result type and attributes

Same as X.

Result value

Examples

DIM (-3.0, 2.0) has the value 0.0. DIM (-3.0, -4.0) has the value 1.0.

Specific Name Argument Type Result Type Pass As Arg?
IDIM any integer  1  same as argument yes
DIM default real default real yes
DDIM double precision real double precision real yes
QDIM  2  REAL(16) REAL(16) yes
Note:
  1. IBM extension: the ability to specify a nondefault integer argument.
  2. IBM extension.