I am using Visual Studio 6 with some old time code written in c. I found an issue where the code looks like this..
int x = 3;
float y = 3.0;
if(x == y){
For your specific example, "do some crazy stuff" will execute. 3.0 will not be 3.0000001 at run-time.
The other answers are more for general cases, but even a hardcoded epsilon is not the greatest idea in the world. A dynamic epsilon based on the actual numbers involved is much better since the more positive and more negative the numbers are, the less likely the hardcoded epsilon will be relevant.