OK. I'll remove ofReal() and ofImaginary().
They can always be added later.
The same may apply to square():
public Complex square() {
return multiply(this);
}
It could be defined differently:
re = ac - bd = aa - bb = (a-b)(a+b)
im = ad + bc = ab + ba = 2 ab
public Complex square() {
return new Complex((real-imaginary)*(real+imaginary),
2*real*imaginary);
}
But this does not account for the overflow protection and handling of
special cases done in multiply. So I'd rather leave it calling
multiply(this). So the square() method seems redundant and I would
recommend dropping it.
It was originally used in computations. Now it is not.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org