Beispiel #1
0
 public object MultiplyBy(RationalNumber factor)
 {
     return(RationalNumber.Create(this.numerator * factor.numerator, this.denominator * factor.denominator));
 }
Beispiel #2
0
 public object SubtractFrom(long number)
 {
     return(RationalNumber.Create((number * this.denominator) - this.numerator, this.denominator));
 }
Beispiel #3
0
 public object Subtract(RationalNumber number)
 {
     return(RationalNumber.Create((this.numerator * number.denominator) - (number.numerator * this.denominator), this.denominator * number.denominator));
 }
Beispiel #4
0
 public object Subtract(long number)
 {
     return(RationalNumber.Create(this.numerator - (number * this.denominator), this.denominator));
 }
Beispiel #5
0
 public object Add(RationalNumber number)
 {
     return(RationalNumber.Create((this.numerator * number.denominator) + (number.numerator * this.denominator), this.denominator * number.denominator));
 }
Beispiel #6
0
 public object Add(long number)
 {
     return(RationalNumber.Create(this.numerator + (number * this.denominator), this.denominator));
 }
Beispiel #7
0
 public object DivideBy(RationalNumber divisor)
 {
     return(RationalNumber.Create(this.numerator * divisor.denominator, this.denominator * divisor.numerator));
 }
Beispiel #8
0
 public object DivideTo(long divident)
 {
     return(RationalNumber.Create(this.denominator * divident, this.numerator));
 }