9.79 DIM — Positive difference
- Description:
-
DIM(X,Y)returns the differenceX-Yif the result is positive; otherwise returns zero. - Standard:
- Fortran 77 and later
- Class:
- Elemental function
- Syntax:
-
RESULT = DIM(X, Y) - Arguments:
-
X The type shall be INTEGERorREALY The type shall be the same type and kind as X. - Return value:
- The return value is of type
INTEGERorREAL. - Example:
-
program test_dim integer :: i real(8) :: x i = dim(4, 15) x = dim(4.345_8, 2.111_8) print *, i print *, x end program test_dim - Specific names:
-
Name Argument Return type Standard DIM(X,Y)REAL(4) X, YREAL(4)Fortran 77 and later IDIM(X,Y)INTEGER(4) X, YINTEGER(4)Fortran 77 and later DDIM(X,Y)REAL(8) X, YREAL(8)Fortran 77 and later
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-5.4.0/gfortran/DIM.html