abs
- Date:
09-23-2013
NAME
ABS, DABS, IABS, IIABS, JIABS, KIABS, CABS, CDABS - Compute absolute value
SYNOPSIS
ABS ([A=]a)
DABS ([A=]a)
IABS ([A=]a)
IIABS ([A=]a)
JIABS ([A=]a)
KIABS ([A=]a)
CABS ([A=]a)
CDABS ([A=]a)
STANDARDS
Fortran
Cray Fortran extensions: IIABS, JIABS, KIABS, CDABS
DESCRIPTION
ABS is the generic function name; the others are specifics. These are elemental intrinsic functions that accept the following argument:
- a
Must be a numeric data type (real, complex, or integer) of any supported kind type. See the RETURN VALUES section for more information on input data types and return values.
These functions evaluate as follows: y = |a|, except for CABS and CDABS, which evaluate the following:
y = | (ar2 + ai2)1/2 |
This CCE intrinsic function does not set errno and does not raise IEEE-754 underflow exceptions. To improve standard compliant behavior, specify -h confirm on the compilation.
NOTES
The ABS, IABS, DABS, and CABS intrinsic function names can be passed as arguments; the others cannot.
The following return values can be returned:
ABS(a):
If |a| = infinity, the result is infinity.
If a= NaN, the result is NaN.
CABS(a):
If ar or ai = NaN, the result is NaN.
If |ar| = infinity and ai is not NaN, the result is infinity.
If |ai| = infinity and ar is not NaN, the result is infinity.
Note: The abs() and cabs() functions have Linux-equivalent names. Use the man -aname option to show all manual pages matching name within the MANPATH search path. Manual pages are displayed in the order found.
RETURN VALUES
ABS returns the absolute value of its argument. The data type of the result is the same as the data type of a except that if input argument a is type complex, the result is type real.
DABS returns the double-precision absolute value of its double-precision argument.
IABS returns the integer absolute value of its integer argument.
IIABS returns the integer (KIND=2) absolute value of its integer (KIND=2) argument.
JIABS returns the integer (KIND=4) absolute value of its integer (KIND=4) argument.
KIABS returns the integer (KIND=8) absolute value of its integer (KIND=8) argument.
CABS returns the absolute value of its single-precision complex argument as a single-precision real number.
CDABS returns the absolute value of its complex double-precision argument as a double-precision real number.