ABS intrinsic function

Standard: F77 F90 F95 F2003 F2008 Example program


ABS ( A )

A : Integer, Real or Complex;

Result : If A is Complex, the result is Real with the same kind as A; otherwise the result has the same type and kind as A.


The value of the result is an approximation to the absolute value of A. Like many intrinsic functions, this is elemental; the result has the same shape as A, with the operation being applied elementwise.

If A is of type Complex, the result is mathematically equal to SQRT(REAL(A)**2+AIMAG(A)**2) but is computed without undue overflow or underflow.


SQRT intrinsic function