9.3. 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