I just wanted to compare a double number saved in a double variable in C and then compare it with value 1.
For example :
double x;
x = 1;
if(x == 1)
call ....
but even when x has value one, this condition evaluated as false because x kept value 0.99999 instead of 1.
how can I manage this problem!!
This is a float so you need to take the precision into consideration:
if(x<1.000001 && x > 0.99999)