예제 #1
0
  public Object power(Number d, Complex c) {
    Complex base = new Complex(d.doubleValue(), 0.0);
    Complex temp = base.power(c);

    if (temp.im() == 0) return new Double(temp.re());
    else return temp;
  }
예제 #2
0
 public Complex sub(Number d, Complex c) {
   return new Complex(d.doubleValue() - c.re(), -c.im());
 }
예제 #3
0
 public Complex sub(Complex c, Number d) {
   return new Complex(c.re() - d.doubleValue(), c.im());
 }
예제 #4
0
 public Complex sub(Complex c1, Complex c2) {
   return new Complex(c1.re() - c2.re(), c1.im() - c2.im());
 }
예제 #5
0
  public Object power(Complex c, Number d) {
    Complex temp = c.power(d.doubleValue());

    if (temp.im() == 0) return new Double(temp.re());
    else return temp;
  }
예제 #6
0
  public Object power(Complex c1, Complex c2) {
    Complex temp = c1.power(c2);

    if (temp.im() == 0) return new Double(temp.re());
    else return temp;
  }