HP-UX Reference (11i v2 03/08) - 3 Library Functions A-M (vol 6)
c
cabs(3M) cabs(3M)
(Itanium(R)-based System Only)
NAME
cabs( ), cabsf( ), cabsl( ), cabsw( ), cabsq( ) - complex absolute value (also called norm, modulus, or magni-
tude) functions
SYNOPSIS
#include <complex.h>
double cabs(double complex z);
float cabsf(float complex z);
long double cabsl(long double complex z);
extended cabsw(extended complex z);
quad cabsq(quad complex z);
DESCRIPTION
These functions are available only for Itanium-based systems.
cabs() returns the complex absolute value of z.
cabsf() is a float complex version of cabs()
; it takes a float complex argument and returns a
float result.
cabsl() is a long double complex version of cabs(); it takes a long double complex argu-
ment and returns a
long double result.
cabsw() is an extended complex version of cabs(); it takes an extended complex argument
and returns an extended result.
cabsq() is equivalent to cabsl() on HP-UX systems.
USAGE
To use these functions, compile with the default
-Ae option. To use cabsw()
or cabsq(), compile
with the
-fpwidetypes option. Make sure your program includes <complex.h>. Link in the math
library by specifying -lm on the compiler or linker command line.
RETURN VALUE
cabs(z) returns the same values and raises the same floating-point exceptions as
hypot(creal(z),cimag(z))
. If the +Onocxlimitedrange compiler option (default for HP’s
C/C++) is not in effect, then
cabs() may be computed with a simpler formula that does not match the
specification for extreme values.
ERRORS
No errors are defined.
SEE ALSO
fabs(3M), carg(3M), complex(5), hypot(3M).
STANDARDS CONFORMANCE
cabs(), cabsf(), cabsl() : ISO/IEC C99 (including Annex G, ‘‘IEC 60559-compatible complex arith-
metic’’)
HP-UX 11i Version 2: August 2003 − 1 − Hewlett-Packard Company Section 3−−65