Description
In the implementation (copied below), two special cases return the same value.
If intended, the two conditions should be grouped.
public Complex log() { if (real == Double.POSITIVE_INFINITY && imaginary == Double.POSITIVE_INFINITY) { return new Complex(Double.POSITIVE_INFINITY, PI_OVER_4); } else if (real == Double.POSITIVE_INFINITY && Double.isNaN(imaginary)) { return new Complex(Double.POSITIVE_INFINITY, Double.NaN); } else if (Double.isNaN(real) && imaginary == Double.POSITIVE_INFINITY) { return new Complex(Double.POSITIVE_INFINITY, Double.NaN); } return new Complex(Math.log(abs()), Math.atan2(imaginary, real)); }
Attachments
Issue Links
- relates to
-
NUMBERS-136 "log10" inconsistent with "log"
- Closed