1. ## Floating point

I am doing a program of finding an exocenter of a triangle.

In one case I want to check if the floating point number is zero or not. I am finding out like this

Code:
```if( !fabs(hold)  )
return true;
else return false;```
This detects hold = 0.000000 nicely but fails when hold = -0.000000!!! What should i do now to detect both! I am using MinGW compiler with CodeBlocks!

2. You need to realise that all floats are approximations. So what might appear to damn close to zero as to not really matter, it will still fail such absolute tests.

Try something like
if ( fabs( hold ) < 0.0000001 )

3. Still not working!!!!

4. As Salem said floats are not 100&#37; accurate due to imprecision caused by rounding. You should create some float functions that make use of an epsilon value for the comparison.

And never ever ever rely on equality when it comes to comparing floats. This will get you into a lot of trouble. A==B is not always true when it comes to floating point values.

5. Are you saying that "fabs()" doesn't return the right thing for negative zero? What does it return?

--
Mats