private Converter<double, T> convToT;
}
public class EntryPoint
{
static void Main() {
Complex<Int64> c =
new Complex<Int64>(
3, 4,
EntryPoint.MultiplyInt64,
EntryPoint.AddInt64,
EntryPoint.DoubleToInt64 );
Console.WriteLine( "Magnitude is {0}",
c.Magnitude );
}
static Int64 MultiplyInt64( Int64 val1, Int64 val2 ) {
return val1 * val2;
}
static Int64 AddInt64( Int64 val1, Int64 val2 ) {
return val1 + val2;
}
static Int64 DoubleToInt64( double d ) {
return Convert.ToInt64( d );
}
}
My implementation of the IComparable<Complex<T>> interface considers two Complex<T> types
equivalent if they have the same magnitude. Therefore, most of the work required to do the com-
parison is done already. However, instead of being able to rely upon the inequality operator of the
C# ...