Next: , Previous: DIGITS, Up: Intrinsic Procedures


7.41 DIM — Dim function

Description:
DIM(X,Y) returns the difference X-Y if the result is positive; otherwise returns zero.
Option:
f95, gnu
Class:
elemental function
Syntax:
X = DIM(X,Y)
Arguments:

X The type shall be INTEGER(*) or REAL(*)
Y The type shall be the same type and kind as X.

Return value:
The return value is of type INTEGER(*) or REAL(*).
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 Option
IDIM(X,Y) INTEGER(4) X,Y INTEGER(4) gnu
DDIM(X,Y) REAL(8) X,Y REAL(8) gnu