<-- Previous || Up || Next -->

Approx Complex Function
Math Complex Class

Public Function ApproxComplex( _
      ByVal vX As Variant _
    , ByVal vY As Variant _
    , Optional ByVal vEpsilon As Variant _
    ) As Variant

"Approximate"
Return True if two expressions are approximately equal.
Compare the real and imaginary parts of complex numbers separately.

Examples:
    ApproxComplex(34.6, 34.59999999) = False
    ApproxComplex(34.6, 34.599999999999) = True
    ApproxComplex("SA", "sa") = False
    ApproxComplex("SA", "SA") = True
See also:
    Approx Function
    Debug.Assert (Visual Basic)
vX: First of two numbers that are compared to see if they are approximately equal. Function returns Null if vX is Null or cannot be fixed up to a real or complex number (as defined by the ComplexStringToReals function).

vY: Second of two numbers that are compared to see if they are approximately equal. Function returns Null if vY is Null or cannot be fixed up to a real or complex number.
Note: If either of the arguments are not numbers, this function compares the values using the EqualLikeDataType function; it passes the arguments to that function and returns its result. In this case, it uses EqualLikeDataType with the Compare Mode of vbBinaryCompare.

vEpsilon: Defines the range of "approximate" values as defined below. vEpsilon defaults to 1E-13 (10 ^ -13) if it is Null of cannot be fixed up to a (real) number.

Definition:

    If Y == 0: Abs(X) < Epsilon
    If Y <> 0: Abs(Y - X) / Y) < Epsilon
v1.5 BugFix: Fixed this function to use the vEpsilon argument instead of always using mcDOUBLE_EPSILON, which was 1E-13.
v1.5 Change: This function has been renamed from Approx to ApproxComplex. There is a new Approx function whick works works on real numbers but not complex numbers.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.