Function Math Complex Class

IsComplex

Determine if the argument vX is a complex (or real) number, according to the way that complex numbers are represented within this library, which is as a string like "R|I" where R is the real part and I is the imaginary part of the number.

Signature (Visual Basic / VBA)

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

Code Example

    IsComplex(34) = True
    IsComplex("12|34") = True
    IsComplex("-12|-34") = True
    IsComplex("23|") = False
    IsComplex("|45") = False
    IsComplex("Something") = False
    IsNull(IsComplex(Null)) = True

Parameters

Parameter Description
vX The value that is checked to see if it represents a complex or real number. Function returns True if vX is numeric or a complex number string. Function returns False if vX is a string which does not represent a complex number. Function returns Null if vX is Null or cannot be fixed up to a real or complex number (as defined by the ComplexStringToReals function).