Representation of a Complex number, i.e. a number which has both a real and imaginary part.
Implementations of arithmetic operations handle {@code NaN} andinfinite values according to the rules for {@link java.lang.Double}, i.e. {@link #equals} is an equivalence relation for all instances that havea {@code NaN} in either real or imaginary part, e.g. the following areconsidered equal:
- {@code 1 + NaNi}
- {@code NaN + i}
- {@code NaN + NaNi}
Note that this is in contradiction with the IEEE-754 standard for floating point numbers (according to which the test {@code x == x} must fail if{@code x} is {@code NaN}). The method {@link org.apache.commons.math3.util.Precision#equals(double,double,int) equals for primitive double} in {@link org.apache.commons.math3.util.Precision}conforms with IEEE-754 while this class conforms with the standard behavior for Java object types.
Implements Serializable since 2.0