This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Chop

Chop[expr]
replaces approximate real numbers in expr that are close to zero by the exact integer .
  • Chop replaces numbers smaller in absolute magnitude than delta by .
  • Chop uses a default tolerance of .
Zero out elements that are very close to 0:
Zero out elements that are very close to 0:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Drop small imaginary parts:
Convert from approximate zeros to exact zeros:
Test if two numbers are the same to a certain tolerance:
They are the same to the default tolerance of :
They are not the same to the tolerance of :
Eliminate very small terms before comparing with Equal:
They are not equal because a small number is not equal to zero:
Once the small terms are eliminated, equality holds:
A functional implementation of Chop:
Chop is much faster for large expressions:
Machine complex numbers have machine reals for both real and imaginary parts:
Consequently, Chop does not make the real part of machine complex numbers an exact zero:
Small imaginary parts from machine complex numbers are eliminated to make a machine real:
New in 1