ABS(3F) ABS(3F)
abs, iabs, dabs, qabs, cabs, zabs, cqabs, iiabs, jiabs  FORTRAN absolute
value
integer i1, i2
real r1, r2
double precision dp1, dp2
real*16 qp1, qp2
complex cx1, cx2
double complex dx1, dx2
complex*32 qx1, qx2
integer*2 ii1, ii2
integer*4 ji1, ji2
r2 = abs(r1)
i2 = iabs(i1)
i2 = abs(i1)
dp2 = dabs(dp1)
dp2 = abs(dp1)
qp2 = qabs(qp1)
qp2 = abs(qp1)
cx2 = cabs(cx1)
cx2 = abs(cx1)
dx2 = zabs(dx1)
dx2 = abs(dx1)
qx2 = cqabs(qx1)
qx2 = abs(qx1)
ii2 = iiabs(ii1)
ii2 = abs(ii1)
ji2 = jiabs(ji1)
ji2 = abs(ji1)
abs is the family of absolute value functions. iabs returns the integer
absolute value of its integer argument. It accepts either integer*2 or
integer*4 arguments and the result is the same type. dabs returns the
doubleprecision absolute value of its doubleprecision argument. qabs
returns the real*16 absolute value of its real*16 argument. cabs returns
the complex absolute value of its complex argument. zabs returns the
doublecomplex absolute value of its doublecomplex argument. cqabs
returns the complex*32 absolute value of its complex*32 argument. iiabs
returns the integer*2 absolute value of its integer*2 argument. jiabs
returns the integer*4 absolute value of its integer*4 argument. The
Page 1
ABS(3F) ABS(3F)
generic form abs returns the type of its argument.
floor(3M).
In two'scomplement integer (integer*2 or integer*4) representation the
absolute value of the negative integer with largest magnitude is
undefined. Some implementations trap this error, but others simply
ignore it.
Page 2
ABS(3M) Last changed: 1698
ABS, IABS, DABS, CABS, CDABS  Computes absolute value
UNICOS and UNICOS/mk systems:
ABS ([A=]a)
IABS ([A=]a)
DABS ([A=]a)
CABS ([A=]a)
UNICOS and IRIX systems:
CDABS ([A=]a)
UNICOS, UNICOS/mk, and IRIX systems
Fortran 90
CDABS is a compiler extension to Fortran 90
ABS is the generic function name. ABS, IABS, DABS, and CABS are
intrinsic and are elemental functions for the CF90 compiler.
The entry point CDABS is provided for support in other languages. It
is not recognized as an intrinsic function; therefore, you must use
the CDIR$ VFUNCTION directive to allow vectorization.
These functions evaluate as follows: y = x, except for CABS and
CDABS, which evaluate the following:
2 2 1/2
y = (x + x ) '
r i
CF90
CDABS is called implicitly by the Fortran 90 compiler as a result of a
generic ABS call with a complex double argument.
CAL Register Usage (Cray Research Systems Only)
Scalar IABS: IABS% (callbyregister)
on entry (S1) = argument
on exit (S1) = result
Scalar DABS: DABS% (callbyregister)
on entry (S1) and (S2) = argument
on exit (S1) and (S2) = result
Scalar CABS: CABS% (callbyregister)
on entry (S1) and (S2) = argument
on exit (S1) = result
Vector CABS: %CABS% (callbyregister)
on entry (V1) = argument vector 1 (real part)
(V2) = argument vector 2 (imaginary part)
on exit (V1) = result vector
Scalar CDABS: CDABS% (callbyregister)
on entry (S1), (S2), (S3), (S4) = argument
on exit (S1), (S2) = result
Vector CDABS: %CDABS% (callbyregister)
on entry (V1), (V2), (V3), (V4) = argument vector
on exit (V1), (V2) = result vector
Argument Ranges 2450
infinity is approximately 10
308
On UNICOS/mk systems, infinity is approximately 10
ABS, IABS, DABS:
x < infinity
CABS, CDABS (CDABS is not available on UNICOS/mk systems):
x , x  < infinity
r i CDABS is an outmoded routine for the CF90 compiler. Refer to the
Fortran Language Reference Manual, Volume 3, publication SR3905, for
information about outmoded features and their preferred standard
alternatives.
The name of the ABS, IABS, DABS, and CABS intrinsic can be passed as
an argument. The name of the CDABS intrinsic cannot be passed as an
argument.
ABS returns the real absolute value of its real argument.
IABS returns the integer absolute value of its integer argument.
DABS returns the doubleprecision absolute value of its
doubleprecision argument.
CABS returns the absolute value of its complex argument as a real
number.
CDABS returns the absolute value of its complex doubleprecision
argument as a doubleprecision number.
When the correct value would overflow, CABS and CDABS abort with a
floatingpoint error.
On CRAY T90 systems that support IEEE arithmetic, the following return
values occur:
ABS(x):
x = infinity, result is infinity
x = NaN, result is NaN
CABS(x):
x or y = NaN, result is NaN
x = infinity and y is not NaN, result is infinity
y = inf and x is not NaN, result is infinity
When overflow occurs for good input, infinity is returned.
Intrinsic Procedures Reference Manual, publication SR2138, for the
printed version of this man page.
ABS(3C) ABS(3C)
abs, labs  return integer absolute value
#include <stdlib.h>
int abs (int i);
long int labs (long int i);
abs and labs return the absolute value of their int or long int operand.
floor(3M).
In two'scomplement representation, the absolute value of the negative
integer with largest magnitude is undefined. In this case, abs (or labs)
will generate a SIGFPE.
Page 1
ABS(3M) Last changed: 1698
ABS, IABS, DABS, CABS, CDABS  Computes absolute value
UNICOS and UNICOS/mk systems:
ABS ([A=]a)
IABS ([A=]a)
DABS ([A=]a)
CABS ([A=]a)
UNICOS and IRIX systems:
CDABS ([A=]a)
UNICOS, UNICOS/mk, and IRIX systems
Fortran 90
CDABS is a compiler extension to Fortran 90
ABS is the generic function name. ABS, IABS, DABS, and CABS are
intrinsic and are elemental functions for the CF90 compiler.
The entry point CDABS is provided for support in other languages. It
is not recognized as an intrinsic function; therefore, you must use
the CDIR$ VFUNCTION directive to allow vectorization.
These functions evaluate as follows: y = x, except for CABS and
CDABS, which evaluate the following:
2 2 1/2
y = (x + x ) '
r i
CF90
CDABS is called implicitly by the Fortran 90 compiler as a result of a
generic ABS call with a complex double argument.
CAL Register Usage (Cray Research Systems Only)
Scalar IABS: IABS% (callbyregister)
on entry (S1) = argument
on exit (S1) = result
Scalar DABS: DABS% (callbyregister)
on entry (S1) and (S2) = argument
on exit (S1) and (S2) = result
Scalar CABS: CABS% (callbyregister)
on entry (S1) and (S2) = argument
on exit (S1) = result
Vector CABS: %CABS% (callbyregister)
on entry (V1) = argument vector 1 (real part)
(V2) = argument vector 2 (imaginary part)
on exit (V1) = result vector
Scalar CDABS: CDABS% (callbyregister)
on entry (S1), (S2), (S3), (S4) = argument
on exit (S1), (S2) = result
Vector CDABS: %CDABS% (callbyregister)
on entry (V1), (V2), (V3), (V4) = argument vector
on exit (V1), (V2) = result vector
Argument Ranges 2450
infinity is approximately 10
308
On UNICOS/mk systems, infinity is approximately 10
ABS, IABS, DABS:
x < infinity
CABS, CDABS (CDABS is not available on UNICOS/mk systems):
x , x  < infinity
r i CDABS is an outmoded routine for the CF90 compiler. Refer to the
Fortran Language Reference Manual, Volume 3, publication SR3905, for
information about outmoded features and their preferred standard
alternatives.
The name of the ABS, IABS, DABS, and CABS intrinsic can be passed as
an argument. The name of the CDABS intrinsic cannot be passed as an
argument.
ABS returns the real absolute value of its real argument.
IABS returns the integer absolute value of its integer argument.
DABS returns the doubleprecision absolute value of its
doubleprecision argument.
CABS returns the absolute value of its complex argument as a real
number.
CDABS returns the absolute value of its complex doubleprecision
argument as a doubleprecision number.
When the correct value would overflow, CABS and CDABS abort with a
floatingpoint error.
On CRAY T90 systems that support IEEE arithmetic, the following return
values occur:
ABS(x):
x = infinity, result is infinity
x = NaN, result is NaN
CABS(x):
x or y = NaN, result is NaN
x = infinity and y is not NaN, result is infinity
y = inf and x is not NaN, result is infinity
When overflow occurs for good input, infinity is returned.
Intrinsic Procedures Reference Manual, publication SR2138, for the
printed version of this man page.
[ Back ]
