DIM(3f) - [FORTRAN:INTRINSIC:NUMERIC] Positive difference
Syntax
Description
Arguments
Return Value
Example
Standard
Class
result = DIM(X, Y)
DIM(X,Y) returns the difference X-Y if the result is positive; otherwise returns zero.
X - The type shall be INTEGER or REAL Y - The type shall be the same type and kind as X.
The return value is of type INTEGER or REAL.
Sample program:
program demo_dim integer :: i real(8) :: x i = dim(4, 15) x = dim(4.345_8, 2.111_8) print *, i print *, x end program demo_dim
[[FORTRAN 77]] and later
[[Elemental procedure|Elemental function]]
dim (3) | March 18, 2019 |