IMSL C# Numerical Library

Complex.CompareTo Method (Complex)

Compares two Complex objects.

public int CompareTo(
   Complex z
);

Parameters

z
A Complex to be compared.

Return Value

The value 0 if z is equal to this Complex; a value less than 0 if this Complex is less than z; and a value greater than 0 if this Complex is greater than z.

Remarks

A lexigraphical ordering is used. First the real parts are compared in the sense of Double.compareTo. If the real parts are unequal this is the return value. If the return parts are equal then the comparison of the imaginary parts is returned.

See Also

Complex Class | Imsl.Math Namespace | Complex.CompareTo Overload List