Next: ACCESS, Previous: ABORT, Up: Intrinsic Procedures
ABS — Absolute valueABS(X) computes the absolute value of X.
RESULT = ABS(X)
| X | The type of the argument shall be an INTEGER(*),
REAL(*), or COMPLEX(*).
|
REAL(*) for a
COMPLEX(*) argument.
program test_abs
integer :: i = -1
real :: x = -1.e0
complex :: z = (-1.e0,0.e0)
i = abs(i)
x = abs(x)
x = abs(z)
end program test_abs
| Name | Argument | Return type | Standard
|
CABS(Z) | COMPLEX(4) Z | REAL(4) | F77 and later
|
DABS(X) | REAL(8) X | REAL(8) | F77 and later
|
IABS(I) | INTEGER(4) I | INTEGER(4) | F77 and later
|
ZABS(Z) | COMPLEX(8) Z | COMPLEX(8) | GNU extension
|
CDABS(Z) | COMPLEX(8) Z | COMPLEX(8) | GNU extension
|