dim(3f) - [FORTRAN:INTRINSIC:NUMERIC] Positive difference
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 use, intrinsic :: iso_fortran_env, only : real_kinds, & & real32, real64, real128 implicit none integer :: i real(kind=real64) :: x i = dim(4, 15) x = dim(4.345_real64, 2.111_real64) print *, i print *, x end program demo_dim
[[FORTRAN 77]] and later
[[Elemental procedure|Elemental function]]
dim (3) | March 11, 2021 |