コード例 #1
0
 public override bool Equals(Number other)
 {
     if (other == null)
     {
         return(false);
     }
     DecimalNumber rhs = Cast(other); return(this.Value == rhs.Value);
 }
コード例 #2
0
        private DecimalNumber Cast(Number other)
        {
            DecimalNumber rhs = other as DecimalNumber;

            if (rhs == null)
            {
                Number.CompatibilityException(this, other);
            }
            return(rhs);
        }
コード例 #3
0
 public override Number Multiply(Number other)
 {
     DecimalNumber rhs = Cast(other); return(new DecimalNumber(this.Value * rhs.Value));
 }
コード例 #4
0
 public override Number Divide(Number other)
 {
     DecimalNumber rhs = Cast(other); return(new DecimalNumber(this.Value / rhs.Value));
 }
コード例 #5
0
 public override Number Subtract(Number other)
 {
     DecimalNumber rhs = Cast(other); return(new DecimalNumber(this.Value - rhs.Value));
 }