FORTRAN Reference Manual

Intrinsic Functions
FORTRAN Reference Manual528615-001
8-4
ABS Function
the arguments and return value are shown in the entries that follow the generic name
in the table.
Considerations
All items in the argument list of an intrinsic function must be the same type, unless
the function’s description specifies otherwise.
When you use an intrinsic name as an actual argument, you must use a specific
function name, not a generic function name. In other contexts, you can use either a
generic or specific function name.
You can use either a specific or a generic function name in an INTRINSIC
statement.
If you use a specific or generic function name as a dummy argument, FORTRAN
does not interpret it as an intrinsic function reference within that program unit.
ABS Function
The ABS function returns the absolute value of its argument.
The following table describes the argument and function type of the generic ABS
function and its associated specific functions.
Considerations
For an integer, real, or double precision argument, the result type of the ABS
function is the same as the type of its argument.
For a complex argument z = CMPLX (x, y), the value of ABS (z) is defined as
and its type is real.
Syntax Argument Type Function Type
ABS (x)
ABS (x) Real Real
IABS (x) Integer Integer
IABS4 (x) Integer*4 Integer*4
IABS8 (x) Integer*8 Integer*8
DABS (x) Double Precision Double Precision
CABS (x) Real Real
x is an arithmetic expression.
X
2
Y
2
+