HP-UX Reference (11i v3 07/02) - 3 Library Functions A-M (vol 6)
c
csqrt(3M) csqrt(3M)
(HP Integrity Server Only)
NAME
csqrt(), csqrtf(), csqrtl(), csqrtw(), csqrtq() - complex square root functions
SYNOPSIS
#include <complex.h>
double complex csqrt(double complex z);
float complex csqrtf(float complex z);
long double complex csqrtl(long double complex z);
extended complex csqrtw(extended complex z);
quad complex csqrtq(quad complex z);
DESCRIPTION
These functions are available only for Integrity servers.
csqrt() returns the complex square root of z in the range of the right half-plane (including the imaginary
axis). There is a branch cut along the negative real axis.
csqrtf() is a float complex version of csqrt(); it takes a float complex argument and
returns a float complex result.
csqrtl() is a long double complex version of csqrt(); it takes a long double complex
argument and returns a long double complex result.
csqrtw() is an extended complex version of csqrt(); it takes an extended complex argu-
ment and returns an extended complex result.
csqrtq() is equivalent to csqrtl() on HP-UX systems.
USAGE
To use these functions, compile with the default -Ae option. To use csqrtw()
or csqrtq(), 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
csqrt(conj( z)) = conj(csqrt( z)).
csqrt(±0+i0) returns +0+i0.
csqrt(x+iInf) returns +Inf+iInf, for all x (including NaN).
csqrt(x+iNaN) returns NaN+iNaN and optionally raises the invalid floating-point exception, for finite x.
csqrt(-Inf+iy) returns +0+iInf, for finite positive-signed y.
csqrt(+Inf+iy) returns +Inf+i0, for finite positive-signed y.
csqrt(-Inf+iNaN) returns NaN±iInf (where the sign of the imaginary part of the result is unspecified).
csqrt(+Inf+iNaN) returns +Inf+iNaN.
csqrt(NaN+iy) returns NaN+iNaN and optionally raises the invalid floating-point exception, for finite y.
csqrt(NaN+iNaN) returns NaN+iNaN.
ERRORS
No errors are defined.
SEE ALSO
sqrt(3M), cpow(3M), complex(5).
STANDARDS CONFORMANCE
csqrt(), csqrtf(), csqrtl() : ISO/IEC C99 (including Annex G, ‘‘IEC 60559-compatible complex
arithmetic’’)
HP-UX 11i Version 3: February 2007 − 1 − Hewlett-Packard Company 233