# How to chop a complex number?

I'm solving some differential equations by iterating and I want to use Chop to get rid of noice smaller than a certain threshold. However, I found that Chop only "chops" the real part, not the imaginary part. My question is, which function can I use in order to approximate both real and imaginary parts that are very close to zero by zero?

For example, if I try to do

A = 10^(-50);
B = I*10^(-50);
Chop[A + B]


The result is just that same number (and actually not even the real number is getting chopped so I'm not sure if I'm understanding this correctly). I would want the result to be zero.

• I found that Chop only "chops" the real part are you sure about this? can you show a MWE showing this? Because I tried this a = 3; b = I* 3.000000000001; r = a + b; Chop[r] and it gives 3. + 3. I so it seems to work. This is using V12 Commented Oct 1, 2019 at 23:59
• Threshold does this, but only on arrays: Threshold[{A + B}]. Commented Oct 2, 2019 at 1:15

I would want the result to be zero.

Exact numbers do not get Choped, because they are exact

A = 10^(-50);
B = I*10^(-50);
Chop[A + B]


To get chop to work, The numbers need to be real and not exact as you have it. So just add a .

A = 10.^(-50);
B = I*10.^(-50);
Chop[A + B]


Or apply N on it

Chop[N[A + B]]