Exemple #1
0
 public Numeric add(Object y, int k) {
   if (y instanceof Complex) {
     Complex yc = (Complex) y;
     if (yc.dimensions() != Dimensions.Empty) throw new ArithmeticException("units mis-match");
     return new DComplex(real + k * yc.reValue(), imag + k * yc.imValue());
   }
   return ((Numeric) y).addReversed(this, k);
 }