public object MultiplyBy(RationalNumber factor) { return(RationalNumber.Create(this.numerator * factor.numerator, this.denominator * factor.denominator)); }
public object SubtractFrom(long number) { return(RationalNumber.Create((number * this.denominator) - this.numerator, this.denominator)); }
public object Subtract(RationalNumber number) { return(RationalNumber.Create((this.numerator * number.denominator) - (number.numerator * this.denominator), this.denominator * number.denominator)); }
public object Subtract(long number) { return(RationalNumber.Create(this.numerator - (number * this.denominator), this.denominator)); }
public object Add(RationalNumber number) { return(RationalNumber.Create((this.numerator * number.denominator) + (number.numerator * this.denominator), this.denominator * number.denominator)); }
public object Add(long number) { return(RationalNumber.Create(this.numerator + (number * this.denominator), this.denominator)); }
public object DivideBy(RationalNumber divisor) { return(RationalNumber.Create(this.numerator * divisor.denominator, this.denominator * divisor.numerator)); }
public object DivideTo(long divident) { return(RationalNumber.Create(this.denominator * divident, this.numerator)); }