Associate
Hi. This is literally making me go insane trying to get something working which seems really simple. Below is a snippet from some C code.
I am trying to test weather an integer is between two floats:
float x,y;
int startx=15;
if((x >=startx) && (x <= (startx+15)))
{
printf("It is in range\n");
}
So startx min and max values are 15 and 30, however I am getting values outside of these ranges. I think it must be a problem with floats.
Any Suggestions?
I am trying to test weather an integer is between two floats:
float x,y;
int startx=15;
if((x >=startx) && (x <= (startx+15)))
{
printf("It is in range\n");
}
So startx min and max values are 15 and 30, however I am getting values outside of these ranges. I think it must be a problem with floats.
Any Suggestions?