OpenBSD manual page server

Manual Page Search Parameters
CSQRT(3) Library Functions Manual CSQRT(3)

csqrt, csqrtf, csqrtlcomplex square root

#include <complex.h>

double complex
csqrt(double complex z);

float complex
csqrtf(float complex z);

long double complex
csqrtl(long double complex z);

The (), () and () functions compute the complex square root of z.

If z = x + iy, then

Re csqrt(z) = [ (|z| + x) / 2 ]^(1/2).
Im csqrt(z) = [ (|z| - x) / 2 ]^(1/2).

Note that -csqrt(z) is also a square root of z. The root chosen is always in the right half plane and Im csqrt(z) has the same sign as y.

The csqrt(), csqrtf() and csqrtl() functions return the complex square root of z.

cpow(3)

The csqrt(), csqrtf() and csqrtl() functions conform to ISO/IEC 9899:1999 (“ISO C99”).

June 5, 2013 OpenBSD-current