Next: ACCESS, Previous: ABORT, Up: Intrinsic Procedures
ABS
— Absolute valueABS(A)
computes the absolute value of A
.
RESULT = ABS(A)
A | 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(A) | COMPLEX(4) Z | REAL(4) | Fortran 77 and later
|
DABS(A) | REAL(8) X | REAL(8) | Fortran 77 and later
|
IABS(A) | INTEGER(4) I | INTEGER(4) | Fortran 77 and later
|
ZABS(A) | COMPLEX(8) Z | COMPLEX(8) | GNU extension
|
CDABS(A) | COMPLEX(8) Z | COMPLEX(8) | GNU extension
|