Exemple #1
0
 public override Numeric addReversed(Numeric x, int k)
 {
     if (!(x is RatNum))
     {
         throw new ArgumentException();
     }
     return(RatNum.add((RatNum)x, this, k));
 }
Exemple #2
0
 public override Numeric add(object y, int k)
 {
     if (y is RatNum)
     {
         return(RatNum.add(this, (RatNum)y, k));
     }
     if (!(y is Numeric))
     {
         throw new ArgumentException();
     }
     return(((Numeric)y).addReversed(this, k));
 }