Esempio n. 1
0
 public static Fraction Reciprocal(Fraction f)
 {
   double newDenominator = f.numerator;
   double newNumerator = f.denominator;
   
   return new Fraction(newNumerator, newDenominator);
 }
Esempio n. 2
0
 public static Fraction MultiplyFractions(Fraction f, Fraction f1)
 {
   double newDenominator = f.denominator * f1.denominator;
   double newNumerator = f.numerator * f1.numerator;
   
   return new Fraction(newNumerator, newDenominator);
 }
Esempio n. 3
0
 public static Fraction DivideFractions(Fraction f, Fraction f1)
 {
   Fraction reciprocal = Reciprocal(f1);
   
   Fraction dividedF = MultiplyFractions(f, reciprocal);
   
   return dividedF;
 }