dim(x, y): Positive Difference or 0

Positive difference or 0.

Declaration

Syntax

retval = dim(x, y)

Arguments

x the input value must be of type real or integer. y the input value must of of the same type and kind as of x.

Return values

The return value is of type integer or real.

Описание

dim(x) computes the difference \(x - y\), if the result is positive, otherwise returns 0.

Types

Supported argument types are real and integer.

Examples

program intrinsics_dim
	print *, dim(2, 3)
	print *, dim(3, 2)
end program

Result:

0
1

See Also