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