The documentation says
Chop does not make the real part of machine complex numbers an exact zero:
In[2]:= Chop[10.^-12 + 2. I]
Out[2]= 0. + 2. I
Why does Chop leaves such a useless 0.?
The documentation says
Chop does not make the real part of machine complex numbers an exact zero:
In[2]:= Chop[10.^-12 + 2. I]
Out[2]= 0. + 2. I
Why does Chop leaves such a useless 0.?
Complex numbers are atomic in Mathematica. Their real and imaginary parts cannot be separated. Thus both must have the same type: either floating point (inexact) or exact number.
1. is an inexact Real, not Complex. It has no imaginary part. Thus Im[1.] can give 0.
But 2. I is an inexact Complex, which does have a real part even if it's zero. Since this is an exact type, its real part is an inexact zero.
Complex[0, 2.]. – J. M.'s missing motivation Oct 12 '15 at 15:43Rationalizeto convert to an exact number. – Bob Hanlon Oct 12 '15 at 16:05