Previously, the test condition for same-ness of two
complex numbers was wrong. The presence of even a single NaN in the real
or imaginary component of either number made both numbers to be
considered same.
This fix changes the logic so that two complex numbers are considered
same if:
* both numbers have both components NaN
* both numbers have one component NaN and the other is exactly equal
* both numbers have both components exactly equal