Package fi.iki.jmtilli.javafastcomplex
Class ComplexUtils
java.lang.Object
fi.iki.jmtilli.javafastcomplex.ComplexUtils
public class ComplexUtils
extends java.lang.Object
A utility class for complex numbers.
This class contains static methods which can be used for objects
implementing the ComplexNumber interface.
-
Constructor Summary
Constructors Constructor Description ComplexUtils() -
Method Summary
Modifier and Type Method Description static doubleabs(ComplexNumber num)Returns the absolute value of the complex number.static doubleabs(ComplexNumberArray num, int i)Returns the absolute value of the complex number.static Complexacos(ComplexNumber c)Calculate the inverse cosine of a complex number.static Complexacos(ComplexNumberArray c, int i)Calculate the inverse cosine of a complex number.static Complexacosh(ComplexNumber c)Calculate the inverse hyperbolic cosine of a complex number.static Complexacosh(ComplexNumberArray c, int i)Calculate the inverse hyperbolic cosine of a complex number.static Complexadd(double a, ComplexNumber b)Add a complex number to a real numberstatic Complexadd(double a, ComplexNumberArray b, int j)Add a complex number to a real numberstatic Complexadd(ComplexNumberArray a, int i, double b)Add a real number to a complex numberstatic Complexadd(ComplexNumberArray a, int i, ComplexNumber b)Add a complex number to a complex numberstatic Complexadd(ComplexNumberArray a, int i, ComplexNumberArray b, int j)Add a complex number to a complex numberstatic Complexadd(ComplexNumber a, double b)Add a real number to a complex numberstatic Complexadd(ComplexNumber a, ComplexNumber b)Add a complex number to a complex numberstatic Complexadd(ComplexNumber a, ComplexNumberArray b, int j)Add a complex number to a complex numberstatic doublearg(ComplexNumber num)Calculates the argument of this complex number.static doublearg(ComplexNumberArray num, int i)Calculates the argument of this complex number.static Complexasin(ComplexNumber c)Calculate the inverse sine of a complex number.static Complexasin(ComplexNumberArray c, int i)Calculate the inverse sine of a complex number.static Complexasinh(ComplexNumber c)Calculate the inverse hyperbolic sine of a complex number.static Complexasinh(ComplexNumberArray c, int i)Calculate the inverse hyperbolic sine of a complex number.static Complexatan(ComplexNumber c)Calculate the inverse tangent of a complex number.static Complexatan(ComplexNumberArray c, int i)Calculate the inverse tangent of a complex number.static Complexatanh(ComplexNumber c)Calculate the inverse hyperbolic tangent of a complex number.static Complexatanh(ComplexNumberArray c, int i)Calculate the inverse hyperbolic tangent of a complex number.static Complexconjugate(ComplexNumber a)Calculates the conjugate of a complex numberstatic Complexconjugate(ComplexNumberArray a, int i)Calculates the conjugate of a complex numberstatic Complexcos(ComplexNumber c)Calculate the cosine of a complex number.static Complexcos(ComplexNumberArray c, int i)Calculate the cosine of a complex number.static Complexcosh(ComplexNumber c)Calculate the hyperbolic cosine of a complex number.static Complexcosh(ComplexNumberArray c, int i)Calculate the hyperbolic cosine of a complex number.static Complexdivide(double d, ComplexNumber c)Divide a real number by a complex numberstatic Complexdivide(double d, ComplexNumberArray c, int i)Divide a real number by a complex numberstatic Complexdivide(ComplexNumberArray a, int i, double d)Divide a complex number by a real numberstatic Complexdivide(ComplexNumberArray a, int i, ComplexNumber b)Divide a complex number by a complex numberstatic Complexdivide(ComplexNumberArray a, int i, ComplexNumberArray b, int j)Divide a complex number by a complex numberstatic Complexdivide(ComplexNumber a, double d)Divide a complex number by a real numberstatic Complexdivide(ComplexNumber a, ComplexNumber b)Divide a complex number by a complex numberstatic Complexdivide(ComplexNumber a, ComplexNumberArray b, int j)Divide a complex number by a complex numberstatic booleanequal(ComplexNumber a, ComplexNumber b)Compare two complex numbers with all cases of NaN considered equal.static booleanequalRealImag(ComplexNumber a, ComplexNumber b)Compare the real and imaginary parts of two complex numbers.static Complexexp(ComplexNumber c)Calculates the exponential of the complex number.static Complexexp(ComplexNumberArray c, int i)Calculates the exponential of the complex number.static Complexexpm1(ComplexNumber c)Returns exp(c)-1.static Complexexpm1(ComplexNumberArray c, int i)Returns exp(c)-1.static inthashCode(ComplexNumber c)Returns a hash code of the complex number.static inthashCode(ComplexNumberArray c, int i)Returns a hash code of the complex number.static Complexinvert(ComplexNumber c)Calculates the inverse of a complex numberstatic Complexinvert(ComplexNumberArray c, int i)Calculates the inverse of a complex numberstatic booleanisInfinite(ComplexNumber n)Returns whether the complex number is infinite.static booleanisInfinite(ComplexNumberArray n, int i)Returns whether the complex number is infinite.static booleanisNaN(ComplexNumber n)Returns whether the complex number is NaN.static booleanisNaN(ComplexNumberArray n, int i)Returns whether the complex number is NaN.static Complexlog(ComplexNumber c)Calculates the natural logarithm of the complex number.static Complexlog(ComplexNumberArray c, int i)Calculates the natural logarithm of the complex number.static Complexlog1p(ComplexNumber c)Returns log(c+1).static Complexlog1p(ComplexNumberArray c, int i)Returns log(c+1).static booleanlongBitsEqual(ComplexNumber a, ComplexNumber b)Compare the bit representations of real and imaginary parts of two complex numbers.static Complexmultiply(double d, ComplexNumber a)Multiply a real number by a complex numberstatic Complexmultiply(double d, ComplexNumberArray a, int i)Multiply a real number by a complex numberstatic Complexmultiply(int i, ComplexNumber a)Multiply an integer by a complex numberstatic Complexmultiply(int x, ComplexNumberArray a, int i)Multiply an integer by a complex numberstatic Complexmultiply(ComplexNumberArray a, int i, double d)Multiply a complex number by a real numberstatic Complexmultiply(ComplexNumberArray a, int i, int x)Multiply a complex number by an integerstatic Complexmultiply(ComplexNumberArray a, int i, ComplexNumber b)Multiply a complex number by a complex numberstatic Complexmultiply(ComplexNumberArray a, int i, ComplexNumberArray b, int j)Multiply a complex number by a complex numberstatic Complexmultiply(ComplexNumber a, double d)Multiply a complex number by a real numberstatic Complexmultiply(ComplexNumber a, int i)Multiply a complex number by an integerstatic Complexmultiply(ComplexNumber a, ComplexNumber b)Multiply a complex number by a complex numberstatic Complexmultiply(ComplexNumber a, ComplexNumberArray b, int j)Multiply a complex number by a complex numberstatic Complexnegate(ComplexNumber a)Calculates the negation of a complex numberstatic Complexnegate(ComplexNumberArray a, int i)Calculates the negation of a complex numberstatic ComplexnewPolar(double abs, double argument)Create a complex number from polar coordinates.static Complexpow(ComplexNumberArray a, int i, double b)Raise a complex number to a real powerstatic Complexpow(ComplexNumberArray a, int i, ComplexNumber b)Raise a complex number to a complex powerstatic Complexpow(ComplexNumberArray a, int i, ComplexNumberArray b, int j)Raise a complex number to a complex powerstatic Complexpow(ComplexNumber a, double b)Raise a complex number to a real powerstatic Complexpow(ComplexNumber a, ComplexNumber b)Raise a complex number to a complex powerstatic Complexpow(ComplexNumber a, ComplexNumberArray b, int j)Raise a complex number to a complex powerstatic Complexsin(ComplexNumber c)Calculate the sine of a complex number.static Complexsin(ComplexNumberArray c, int i)Calculate the sine of a complex number.static Complexsinh(ComplexNumber c)Calculate the hyperbolic sine of a complex number.static Complexsinh(ComplexNumberArray c, int i)Calculate the hyperbolic sine of a complex number.static Complexsqrt(ComplexNumber c)Calculates the square root of a complex numberstatic Complexsqrt(ComplexNumberArray c, int i)Calculates the square root of a complex numberstatic Complexsubtract(double a, ComplexNumber b)Subtract a complex number from a real numberstatic Complexsubtract(double a, ComplexNumberArray b, int j)Subtract a complex number from a real numberstatic Complexsubtract(ComplexNumberArray a, int i, double b)Subtract a real number from a complex numberstatic Complexsubtract(ComplexNumberArray a, int i, ComplexNumber b)Subtract a complex number from a complex numberstatic Complexsubtract(ComplexNumberArray a, int i, ComplexNumberArray b, int j)Subtract a complex number from a complex numberstatic Complexsubtract(ComplexNumber a, double b)Subtract a real number from a complex numberstatic Complexsubtract(ComplexNumber a, ComplexNumber b)Subtract a complex number from a complex numberstatic Complexsubtract(ComplexNumber a, ComplexNumberArray b, int j)Subtract a complex number from a complex numberstatic Complextan(ComplexNumber c)Calculate the tangent of a complex number.static Complextan(ComplexNumberArray c, int i)Calculate the tangent of a complex number.static Complextanh(ComplexNumber c)Calculate the hyperbolic tangent of a complex number.static Complextanh(ComplexNumberArray c, int i)Calculate the hyperbolic tangent of a complex number.static java.lang.StringtoString(ComplexNumber num)Returns a String representation of a complex number.static java.lang.StringtoString(ComplexNumberArray num, int i)Returns a String representation of a complex number.
-
Constructor Details
-
ComplexUtils
public ComplexUtils()
-
-
Method Details
-
isNaN
Returns whether the complex number is NaN. A comples number is considered NaN if either the real or imaginary part is NaN.- Parameters:
n- The complex number- Returns:
- Whether the complex number is NaN
-
isNaN
Returns whether the complex number is NaN. A comples number is considered NaN if either the real or imaginary part is NaN.- Parameters:
n- The complex number arrayi- The array index- Returns:
- Whether the complex number is NaN
-
isInfinite
Returns whether the complex number is infinite. A comples number is considered infinite if either the real or imaginary part is infinite and the complex number is not NaN.- Parameters:
n- The complex number- Returns:
- Whether the complex number is infinite
-
isInfinite
Returns whether the complex number is infinite. A comples number is considered infinite if either the real or imaginary part is infinite and the complex number is not NaN.- Parameters:
n- The complex number arrayi- The array index- Returns:
- Whether the complex number is infinite
-
abs
Returns the absolute value of the complex number. If the complex number is NaN, returns NaN. If the complex number is infinite, returns the infinity.- Parameters:
num- The complex number- Returns:
- The absolute value of the complex number.
-
abs
Returns the absolute value of the complex number. If the complex number is NaN, returns NaN. If the complex number is infinite, returns the infinity.- Parameters:
num- The complex number arrayi- The array index- Returns:
- The absolute value of the complex number.
-
arg
Calculates the argument of this complex number. The argument is the angle between the positive real axis and the point that represents this number in the complex plane.- Parameters:
num- The complex number- Returns:
- -pi≤x≤pi the argument
-
arg
Calculates the argument of this complex number. The argument is the angle between the positive real axis and the point that represents this number in the complex plane.- Parameters:
num- The complex number arrayi- The array index- Returns:
- -pi≤x≤pi the argument
-
newPolar
Create a complex number from polar coordinates.- Parameters:
abs- The absolute valueargument- The argument- Returns:
- The new complex number
-
pow
Raise a complex number to a real power- Parameters:
a- The complex baseb- The real power- Returns:
- The result
-
pow
Raise a complex number to a real power- Parameters:
a- The complex base arrayi- The array indexb- The real power- Returns:
- The result
-
pow
Raise a complex number to a complex power- Parameters:
a- The complex baseb- The complex power- Returns:
- The result
-
pow
Raise a complex number to a complex power- Parameters:
a- The complex base arrayi- The array indexb- The complex power- Returns:
- The result
-
pow
Raise a complex number to a complex power- Parameters:
a- The complex base arrayi- The array index of first arrayb- The complex power araryj- The array index of second array- Returns:
- The result
-
pow
Raise a complex number to a complex power- Parameters:
a- The complex baseb- The complex power arrayj- The array index- Returns:
- The result
-
toString
Returns a String representation of a complex number.- Parameters:
num- The complex number array- Returns:
- "NaN" if NaN
re if purely real
im+"i" if purely imaginary
(re + " + " + im + "i") if im>0
(re + " - " + (-im) + "i") if im<0
-
toString
Returns a String representation of a complex number.- Parameters:
num- The complex number arrayi- The array index- Returns:
- "NaN" if NaN
re if purely real
im+"i" if purely imaginary
(re + " + " + im + "i") if im>0
(re + " - " + (-im) + "i") if im<0
-
add
Add a complex number to a complex number- Parameters:
a- A complex numberb- A complex number- Returns:
- The sum
-
add
Add a complex number to a complex number- Parameters:
a- A complex number arrayi- The array indexb- A complex number- Returns:
- The sum
-
add
Add a complex number to a complex number- Parameters:
a- A complex number arrayi- The array index to first arrayb- A complex number arrayj- The array index to second array- Returns:
- The sum
-
add
Add a complex number to a complex number- Parameters:
a- A complex numberb- A complex number arrayj- The array index- Returns:
- The sum
-
add
Add a real number to a complex number- Parameters:
a- The complex numberb- The real number- Returns:
- The sum
-
add
Add a real number to a complex number- Parameters:
a- The complex number arrayi- The array indexb- The real number- Returns:
- The sum
-
add
Add a complex number to a real number- Parameters:
a- The real numberb- The complex number- Returns:
- The sum
-
add
Add a complex number to a real number- Parameters:
a- The real numberb- The complex number arrayj- The array index- Returns:
- The sum
-
subtract
Subtract a complex number from a complex number- Parameters:
a- The minuendb- The subtrahend- Returns:
- The difference
-
subtract
Subtract a complex number from a complex number- Parameters:
a- The minuend arrayi- The array indexb- The subtrahend- Returns:
- The difference
-
subtract
Subtract a complex number from a complex number- Parameters:
a- The minuend arrayi- The first array indexb- The subtrahend arrayj- The second array index- Returns:
- The difference
-
subtract
Subtract a complex number from a complex number- Parameters:
a- The minuendb- The subtrahend arraryj- The array index- Returns:
- The difference
-
subtract
Subtract a real number from a complex number- Parameters:
a- The complex numberb- The real number- Returns:
- The difference
-
subtract
Subtract a real number from a complex number- Parameters:
a- The complex number arrayi- The array indexb- The real number- Returns:
- The difference
-
subtract
Subtract a complex number from a real number- Parameters:
a- The real numberb- The complex number- Returns:
- The difference
-
subtract
Subtract a complex number from a real number- Parameters:
a- The real numberb- The complex number arrayj- The array index- Returns:
- The difference
-
multiply
Multiply a complex number by a complex number- Parameters:
a- A complex numberb- A complex number- Returns:
- The result of the multiplication
-
multiply
Multiply a complex number by a complex number- Parameters:
a- A complex number arrayi- The array indexb- A complex number- Returns:
- The result of the multiplication
-
multiply
Multiply a complex number by a complex number- Parameters:
a- A complex number arrayi- The array index to first arrayb- A complex number arrayj- The array index to second array- Returns:
- The result of the multiplication
-
multiply
Multiply a complex number by a complex number- Parameters:
a- A complex numberb- A complex number araryj- The array index- Returns:
- The result of the multiplication
-
divide
Divide a complex number by a complex number- Parameters:
a- The dividendb- The divisor- Returns:
- The result of the division
-
divide
Divide a complex number by a complex number- Parameters:
a- The dividend arrayi- The array indexb- The divisor- Returns:
- The result of the division
-
divide
Divide a complex number by a complex number- Parameters:
a- The dividend arrayi- The array index to first arrayb- The divisor arrayj- The array index to second array- Returns:
- The result of the division
-
divide
Divide a complex number by a complex number- Parameters:
a- The dividendb- The divisor arrayj- The array index- Returns:
- The result of the division
-
divide
Divide a complex number by a real number- Parameters:
a- The complex numberd- The real number- Returns:
- The result of the division
-
divide
Divide a complex number by a real number- Parameters:
a- The complex number arrayi- The array indexd- The real number- Returns:
- The result of the division
-
multiply
Multiply a complex number by a real number- Parameters:
a- The complex numberd- The real number- Returns:
- The result of the multiplication
-
multiply
Multiply a complex number by a real number- Parameters:
a- The complex number arrayi- The array indexd- The real number- Returns:
- The result of the multiplication
-
multiply
Multiply a real number by a complex number- Parameters:
d- The real numbera- The complex number- Returns:
- The result of the multiplication
-
multiply
Multiply a real number by a complex number- Parameters:
d- The real numbera- The complex number arrayi- The array index- Returns:
- The result of the multiplication
-
multiply
Multiply a complex number by an integer- Parameters:
a- The complex numberi- The integer- Returns:
- The result of the multiplication
-
multiply
Multiply a complex number by an integer- Parameters:
a- The complex number arrayi- The array indexx- The integer- Returns:
- The result of the multiplication
-
multiply
Multiply an integer by a complex number- Parameters:
i- The integera- The complex number- Returns:
- The result of the multiplication
-
multiply
Multiply an integer by a complex number- Parameters:
x- The integera- The complex number arrayi- The array index- Returns:
- The result of the multiplication
-
negate
Calculates the negation of a complex number- Parameters:
a- The complex number- Returns:
- -a
-
negate
Calculates the negation of a complex number- Parameters:
a- The complex number arrayi- The array index- Returns:
- -a
-
conjugate
Calculates the conjugate of a complex number- Parameters:
a- The complex number- Returns:
- The complex conjugate of a
-
conjugate
Calculates the conjugate of a complex number- Parameters:
a- The complex number arrayi- The array index- Returns:
- The complex conjugate of a
-
divide
Divide a real number by a complex number- Parameters:
d- The real numberc- The complex number- Returns:
- The result of the division
-
divide
Divide a real number by a complex number- Parameters:
d- The real numberc- The complex number arrayi- The array index- Returns:
- The result of the division
-
invert
Calculates the inverse of a complex number- Parameters:
c- The complex number- Returns:
- 1 divided by c
-
invert
Calculates the inverse of a complex number- Parameters:
c- The complex number arrayi- The array index- Returns:
- 1 divided by c
-
sqrt
Calculates the square root of a complex number- Parameters:
c- The complex number- Returns:
- The square root of c
-
sqrt
Calculates the square root of a complex number- Parameters:
c- The complex number arrayi- The array index- Returns:
- The square root of c
-
exp
Calculates the exponential of the complex number.- Parameters:
c- The complex number- Returns:
- e raised to the power c
-
exp
Calculates the exponential of the complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- e raised to the power c
-
log
Calculates the natural logarithm of the complex number.- Parameters:
c- The complex number- Returns:
- The natural logarithm
-
log
Calculates the natural logarithm of the complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The natural logarithm
-
log1p
Returns log(c+1). For values of c near 0, calculating log1p(c) is much more accurate than calculating log(1+c).- Parameters:
c- The complex number- Returns:
- The value log(1+x)
-
log1p
Returns log(c+1). For values of c near 0, calculating log1p(c) is much more accurate than calculating log(1+c).- Parameters:
c- The complex number arrayi- The array index- Returns:
- The value log(1+x)
-
expm1
Returns exp(c)-1. For values of c near 0, calculating expm1(c) is much more accurate than calculating exp(c)-1.- Parameters:
c- The complex number- Returns:
- The value exp(c)-1
-
expm1
Returns exp(c)-1. For values of c near 0, calculating expm1(c) is much more accurate than calculating exp(c)-1.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The value exp(c)-1
-
acosh
Calculate the inverse hyperbolic cosine of a complex number.- Parameters:
c- The complex number- Returns:
- The inverse hyperbolic cosine of c
-
acosh
Calculate the inverse hyperbolic cosine of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The inverse hyperbolic cosine of c
-
asinh
Calculate the inverse hyperbolic sine of a complex number.- Parameters:
c- The complex number- Returns:
- The inverse hyperbolic sine of c
-
asinh
Calculate the inverse hyperbolic sine of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The inverse hyperbolic sine of c
-
atanh
Calculate the inverse hyperbolic tangent of a complex number.- Parameters:
c- The complex number- Returns:
- The inverse hyperbolic tangent of c
-
atanh
Calculate the inverse hyperbolic tangent of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The inverse hyperbolic tangent of c
-
acos
Calculate the inverse cosine of a complex number.- Parameters:
c- The complex number- Returns:
- The inverse cosine of c
-
acos
Calculate the inverse cosine of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The inverse cosine of c
-
asin
Calculate the inverse sine of a complex number.- Parameters:
c- The complex number- Returns:
- The inverse sine of c
-
asin
Calculate the inverse sine of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The inverse sine of c
-
atan
Calculate the inverse tangent of a complex number.- Parameters:
c- The complex number- Returns:
- The inverse tangent of c
-
atan
Calculate the inverse tangent of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The inverse tangent of c
-
cos
Calculate the cosine of a complex number.- Parameters:
c- The complex number- Returns:
- The cosine of c
-
cos
Calculate the cosine of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The cosine of c
-
sin
Calculate the sine of a complex number.- Parameters:
c- The complex number- Returns:
- The sine of c
-
sin
Calculate the sine of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The sine of c
-
tan
Calculate the tangent of a complex number.- Parameters:
c- The complex number- Returns:
- The tangent of c
-
tan
Calculate the tangent of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The tangent of c
-
cosh
Calculate the hyperbolic cosine of a complex number.- Parameters:
c- The complex number- Returns:
- The hyperbolic cosine of c
-
cosh
Calculate the hyperbolic cosine of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The hyperbolic cosine of c
-
sinh
Calculate the hyperbolic sine of a complex number.- Parameters:
c- The complex number- Returns:
- The hyperbolic sine of c
-
sinh
Calculate the hyperbolic sine of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The hyperbolic sine of c
-
tanh
Calculate the hyperbolic tangent of a complex number.- Parameters:
c- The complex number- Returns:
- The hyperbolic tangent of c
-
tanh
Calculate the hyperbolic tangent of a complex number.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The hyperbolic tangent of c
-
hashCode
Returns a hash code of the complex number. The hash code is based on the bit representations of the real and imaginary parts. If two complex numbers are considered equal by the equal method, they have the same hash code.- Parameters:
c- The complex number- Returns:
- The hash code
-
hashCode
Returns a hash code of the complex number. The hash code is based on the bit representations of the real and imaginary parts. If two complex numbers are considered equal by the equal method, they have the same hash code.- Parameters:
c- The complex number arrayi- The array index- Returns:
- The hash code
-
equal
Compare two complex numbers with all cases of NaN considered equal. Note that this compares the bit representations of the real and imaginary parts. All instances of NaN are considered equal to each other. Thus for example NaN is equal to itself and +0.0+0.0i is not equal to -0.0-0.0i. This definition allows hash tables to work properly.- Returns:
- true if both complex numbers are NaN
true if the bit representations of the real and imaginary parts are equal
false otherwise
-
longBitsEqual
Compare the bit representations of real and imaginary parts of two complex numbers. Note that this compares the bit representations of the real and imaginary parts separately. Thus for example +0.0i+0.0i is not equal to -0.0-0.0i. Note that eg. NaN+0i is not equal to 0+NaNi, ie. all instances of NaN are not considered equal to each other.- Returns:
- true if the bit representations of the real and imaginary
parts are equal
false otherwise
-
equalRealImag
Compare the real and imaginary parts of two complex numbers. Note that this compares the real and imaginary parts with the "==" operator. Thus for example NaN is not equal to itself, and +0.0+0.0i is considered equal to -0.0-0.0i.- Returns:
- true if the the real and imaginary parts are equal with
the "==" comparison operator
false otherwise
-