Exemplo n.º 1
0
 public static Fraction Mul(Fraction arg1, Fraction arg2)
 {
     Fraction result = new Fraction((arg1.Numerator * arg2.Numerator).ToString() + "/" + (arg1.Denominator * arg2.Denominator).ToString());
     result.OptimizeFraction();
     return result;
 }
Exemplo n.º 2
0
        public static Fraction Div(Fraction arg1, Fraction arg2)
        {
            if (arg2.Numerator == 0)
                throw new DivideByZeroException();

            Fraction result = new Fraction((arg1.Numerator*arg2.Denominator).ToString()+"/"+(arg1.Denominator*arg2.Numerator).ToString());
            result.OptimizeFraction();
            return result;
        }