9.3. ABS
9.3 ABS — Absolute value
- Description:
-
ABS(A)
computes the absolute value ofA
. - Standard:
-
Fortran 77 and later, has overloads that are GNU extensions
- Class:
-
Elemental function
- Syntax:
-
RESULT = ABS(A)
- Arguments:
-
A The type of the argument shall be an INTEGER
,REAL
, orCOMPLEX
. - Return value:
-
The return value is of the same type and kind as the argument except the return value is
REAL
for aCOMPLEX
argument. - Example:
-
program test_abs integer :: i = -1 real :: x = -1.e0