IMSL C# Numerical Library

Complex.CompareTo Method (Object)

Compares this Complex to another Object.

public int CompareTo(
   object obj
);

Parameters

obj
An Object to be compared.

Return Value

An int, 0 if obj is equal to this Complex; a value less than 0 if this Complex is less than obj; and a value greater than 0 if this Complex is greater than obj.

Implements

IComparable.CompareTo

Remarks

If the Object is a Complex, this function behaves like compareTo(Complex). Otherwise, it throws a InvalidCastException (as Complex objects are comparable only to other Complex objects).

Exceptions

Exception TypeCondition
InvalidCastException is thrown if obj is not a Complex object

See Also

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