ABS(A)

Purpose

Absolute value.

Class

Elemental function

Argument type and attributes

A
must be of type integer, real, or complex.

Result type and attributes

The same as A, except that if A is complex, the result is real.

Result value

Examples

ABS ((3.0, 4.0)) has the value 5.0.

Specific Name Argument Type Result Type Pass As Arg?
IABS any integer  1   2  same as argument yes
ABS default real default real yes
DABS double precision real double precision real yes
QABS  1  REAL(16) REAL(16) yes
CABS default complex default real yes
CDABS  1  double complex double precision real yes
ZABS  1  double complex double precision real yes
CQABS  1  COMPLEX(16) REAL(16) yes
Note:
  •  1  IBM extension
  •  2  the ability to specify a nondefault integer argument.
Given that X is a complex number in the form a + bi, where i = (-1)½:
  1. abs(b) must be less than or equal to 88.7228; a is any real value.
  2. abs(b) must be less than or equal to 709.7827; a is any real value.