Function Math Complex Class

Sign

Sign of a real or complex number.

Signature (Visual Basic / VBA)

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

Code Example

    Sign(-2) = -1
    Sign(0) = 0
    Sign(3) = 1
    Sign("0|3") = "0|-1"
    Sign("4|5") = "0.624695047554424|0.78086880944303"
    Sign("4|-5") = "0.624695047554424|-0.78086880944303"
    IsNull(Sign(Null)) = True

Parameters

Parameter Description
vX The number whose sign 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.