Help Center

CSqrfunction

Returns the square root of a complex.

Numeric DatatypesfunctionAfxComplex.incdocumented

Syntax

FUNCTION CSqr (BYREF value AS _complex) AS _complex
Also documented as CSqrt — one description covers them all.

Parameters

NameDescription
valueA complex 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.

Examples

DIM z AS _complex = (2, 3) z = CSqr(z) PRINT CStr(z) Output: 1.67414922803554 +0.895977476129838 * i

DIM z AS _complex = (-1) z = CSqr(z) PRINT CStr(z) Output: 0 +1.0 * i

Compute the square root of -1:

Reference

  • Include file AfxComplex.inc
  • Defined in AfxNova/AfxComplex.inc:678
  • Documented in Numeric Datatypes/Complex Numbers Procedures.md
  • Topic: Complex Numbers Procedures