/// <summary> /// Operator adding fraction and number /// </summary> public static Fraction operator +(Fraction fraction, int number) { var result = new Fraction(fraction); result.Add(number); return result; }
/// <summary> /// Operator subtracting number and fraction /// </summary> public static Fraction operator -(int number, Fraction fraction) { var result = new Fraction(fraction); result.Numerator *= -1; result.Add(number); return result; }
/// <summary> /// Operator adding two fractions /// </summary> public static Fraction operator +(Fraction first, Fraction second) { var result = new Fraction(first); result.Add(second); return result; }