Function Math Complex Class

Sqrt

" Square Root" Square root of a real or complex number.

Signature (Visual Basic / VBA)

Public Function Sqrt( _
    ByVal vX As Variant _
    ) As Variant

Code Example

    Sqrt(3.4) = 1.84390889145858
    Sqrt(-3.4) = "0|1.84390889145858"
    Sqrt("-2|-3") = "0.895977476129838|-1.67414922803554"
    Sqrt("-2|3") = "0.895977476129838|1.67414922803554"
    IsNull(Sqrt(Null)) = True

Parameters

Parameter Description
vX The number whose square root is returned. Function returns Null if vX is Null or cannot be fixed up to a real or complex number (as defined by the ComplexStringToReals function). Complex numbers are represented within strings as "R|I" where R is the real part and I is the imaginary part.

Notes & Version History

Note Sqrt(X) is equivalent to and more accurate than NthRoot (X, 2).