ABS

9.3 ABS — Absolute value

Description:
ABS(A) computes the absolute value of A.
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, or COMPLEX.
Return value:
The return value is of the same type and kind as the argument except the return value is REAL for a COMPLEX argument.
Example:
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 progra