예제 #1
0
        public static Fraction operator -(Fraction a, Fraction b)
        {
            Fraction fraction = new Fraction((a.Num * b.Den) - (b.Num * a.Den), a.Den * b.Den);

            return(fraction.Normalized);
        }
예제 #2
0
        public static Fraction operator /(Fraction a, Fraction b)
        {
            Fraction fraction = new Fraction(a.Num * b.Den, a.Den * b.Num);

            return(fraction.Normalized);
        }
예제 #3
0
        int IComparable.CompareTo(object obj)
        {
            Fraction fraction = (Fraction)obj;

            return(this.Value.CompareTo(fraction.Value));
        }