public int CompareTo(Fraction other) { long d = (long)this.N * (long)(other.D) - (long)other.N * (long)(this.D); return (d > 0) ? 1 : ((d < 0) ? -1 : 0); }
public static void Main() { object o1 = 1.1; object o2 = 2.3; object o3 = new Fraction(5,2); Console.WriteLine("{0} + {1} = {2}", o1, o3, ObjectType.AddObj(o1, o3)); }