4

If I use

Chop[10^-4, 10^-3]

then I'd expect the output to be zero. However, this is not the case. There is of course a very easy workaround since I can define my own "chop"

chop[x_,dx_] := If[Abs[x] < dx, 0, x]

but why is the innate version failing?

Öskå
  • 8,587
  • 4
  • 30
  • 49
JeffDror
  • 1,880
  • 1
  • 13
  • 29

1 Answers1

8

The documentation states that Chop

replaces approximate real numbers in expr that are close to zero by the exact integer 0.

but you number is not approximate! Try

Chop[10^-4 // N, 10^-3]

It might be enlightening to evaluate 10^-4 // FullForm to see how 10^-4 is represented in Mathematica.

C. E.
  • 70,533
  • 6
  • 140
  • 264