In one of my calculations, I get -1.11022*10^-16 as one of my eigenvalues for a matrix. It's essentially zero and I suppose I could use SetPrecision to make it zero but I wonder what's a good practice here? Should I maybe include something at the beginning of the code to specify precision for everything? Or do I just set arbitrary precision when I feel my expression is not simplified enough?
I'm pretty new to Mathematica.
As others have commented, after trying in different calculations, I think use \Chop after each calculation is the best and safest way.One can also explicitly specify the digits to keep.
Chop
. $\endgroup$0.
to0.
. This can be done byThreshold
and by specifying a suitable tolerance as second argument. $\endgroup$