dim(x,y)
returns the difference x-y
if the result is positive; otherwise returns zero.
FORTRAN 77 and later
result = dim(x, y)
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
.
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