Possible Duplicate:
Most effective way for float and double comparison
In my program some double variables take values of the form 1.00000001. Equality check of these variables with 1 obviously fails.
I wanted to know how can I reduce the precision of double type variables in c, so that equality with integers works.
1.5?1.5equality should return false. Let us say, anything after fifth decimal place should be ignored.