Elemental Intrinsic Function (Generic): Returns the difference between two numbers (if the difference is positive).
Syntax
Results:
The result type is the same as x. The value of the result is x - y if x is greater than y; otherwise, the value of the result is zero.
Specific Name | Argument type | Result Type |
---|---|---|
INTEGER(1) | INTEGER(1) | |
IIDIM | INTEGER(2) | INTEGER(2) |
IDIM 1 | INTEGER(4) | INTEGER(4) |
KIDIM | INTEGER(8) | INTEGER(8) |
DIM | REAL(4) | REAL(4) |
DDIM | REAL(8) | REAL(8) |
QDIM 2 | REAL(16) | REAL(16) |
1 Or JIDIM.
2 VMS and U*X |
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
Examples
DIM (6, 2) has the value 4.
DIM (-4.0, 3.0) has the value 0.0.
The following shows another example:
INTEGER i
REAL r
REAL(8) d
i = IDIM(10, 5) ! returns 5
r = DIM (-5.1, 3.7) ! returns 0.0
d = DDIM (10.0D0, -5.0D0) ! returns 15.0D0