Well, that is an issue. In this case, I think that 10**-6 is small enough though I suppose we can reduce it further to about 10**-10. The thing is that we don't want to have too small a value to compare against since then the difference might not small enough.
While debugging, I observed that if the difference isn't exactly zero, then it was of the order 10**-15 to 10**-17. So, I think 10**-10 should be small enough but not too small that it undermines the purpose if comparing.