CComplex.CSqrtmethod
Returns the square root of a complex number.
Syntax
FUNCTION CSqrt () AS CComplex
FUNCTION CSqrt (BYVAL value AS DOUBLE) AS CComplex
Also documented as
CSqr — one description covers them all.Parameters
| Name | Description | |
|---|---|---|
value | A double value representing a real number. |
Description
Returns the square root of the complex number z. The branch cut is the negative real axis. The result always lies in the right half of the complex plane.
Returns the complex square root of the real number x, where x may be negative.
Examples
DIM cpx AS CComplex = CComplex(2, 3) PRINT cpx.CSqrt Output: 1.67414922803554 +0.895977476129838 * i
DIM cpx AS CComplex = CComplex(-1) PRINT cpx.CSqr Output: 0 +1.0 * i
Compute the square root of -1:
Reference
- Include file
CComplex.inc - Defined in AfxNova/CComplex.inc:1053
- Documented in Numeric Datatypes/CComplex Class.md
- Topic: CComplex Class