Debian Codegraph @

doc/src/intrinsics/numeric/dim.md

raw
1 # dim(x, y): Positive Difference or 0
2
3 Positive difference or 0.
4
5 ## Declaration
6
7 ### Syntax
8
9 ```fortran
10 retval = dim(x, y)
11 ```
12
13 ### Arguments
14
15 `x` the input value must be of type real or integer.
16 `y` the input value must of of the same type and kind as of `x`.
17
18 ### Return values
19
20 The return value is of type integer or real.
21
22 ## Description
23
24 **dim(x)** computes the difference $x - y$, if the result is positive, otherwise
25 returns 0.
26
27 ## Types
28
29 Supported argument types are real and integer.
30
31 ## Examples
32
33 ```fortran
34 program intrinsics_dim
35 print *, dim(2, 3)
36 print *, dim(3, 2)
37 end program
38 ```
39
40 **Result:**
41
42 ```
43 0
44 1
45 ```
46
47 ## See Also