# How to make the imaginary part of a +0. I zero globally?

Values like a +0. I are really annoying. Answers from

give me some clue, but I find $Post = Chop[#, 10^-16] &; doesn't work, for example : Print[MatrixForm[FourierDCT[FourierDCT[{0, 0, 1, 0, 0}, 2], 3]]]  gives (0. -5.55112*10^-17 1. 1.38778*10^-17 1.38778*10^-17 ), which means the small digits still exist. - What's wrong with Print[MatrixForm[FourierDCT[FourierDCT[{0, 0, 1, 0, 0}, 2], 3] // Chop]]? You can't use Chop outside the MatrixForm if that's the problem you've been having. – Jonathan Shock May 7 at 5:55 But you know, it's probably a mistake to try to always hide small numbers --- someday you may need to know that they are not really zero. Just choose Chop whenever you want to display things. – bill s May 7 at 5:57 Jonathan Shock: I don't know Chop fails outside the MatrixForm. But doesn't$Post = Chop[#, 10^-16] &; tells Mathematica to neglect digits smaller than 10^-16 automatically？ –  novice May 7 at 6:12
@bills But isn't $Post (or $PrePrint) just the right thing to use whenever one wants to display things? The problem here is that it won't apply to Printed output (try it without the Print statement). –  István Zachar May 7 at 6:12
The default for all numbers is Complex. But if you use only rationals (and don't do stuff like Sqrt[-rational] then everything will remain rational. But if you do operations that generate complex numbers (like Sqrt or roots of polynmials, there are lots!) then you need to deal with it explicitly. You can always apply Re to take only the real part or Chop to remove small imaginary values. –  bill s May 7 at 8:35