csqrtf, csqrt, csqrtl
From cppreference.com
| Defined in header <complex.h>
|
||
| (1) | (since C99) | |
| (2) | (since C99) | |
| (3) | (since C99) | |
| Defined in header <tgmath.h>
|
||
| #define sqrt( z ) |
(4) | (since C99) |
1-3) Computes the complex square root of
z with branch cut along the negative real axis.4) Type-generic macro: If
z has type long double complex, csqrtl is called. if z has type double complex, csqrt is called, if z has type float complex, csqrtf is called. If z is real or integer, then the macro invokes the corresponding real function (sqrtf, sqrt, sqrtl). If z is imaginary, the corresponding complex number version is called.Parameters
| z | - | complex argument |
Return value
If no errors occur, returns the square root of z, in the range of the right half-plane, including the imaginary axis ([0; +∞) along the real axis and (−∞; +∞) along the imaginary axis.)
Error handling and special values
Errors are reported consistent with math_errhandling
If the implementation supports IEEE floating-point arithmetic,
- The function is continuous onto the branch cut taking into account the sign of imaginary part
- csqrt(conj(z)) == conj(csqrt(z))
- If
zis±0+0i, the result is+0+0i - If
zisx+∞i, the result is+∞+∞ieven if x is NaN - If
zisx+NaNi, the result isNaN+NaNi(unless x is ±∞) and FE_INVALID may be raised - If
zis-∞+yi, the result is+0+∞ifor finite positive y - If
zis+∞+yi, the result is+∞+0i)for finite positive y - If
zis-∞+NaNi, the result isNaN±∞(sign of imaginary part unspecified) - If
zis+∞+NaNi, the result is+∞+NaNi - If
zisNaN+yi, the result isNaN+NaNiand FE_INVALID may be raised - If
zisNaN+NaNi, the result isNaN+NaNi