#include<stdio.h>
int main()
{
int loopCounter = 0;
float data1,data2;
data1 = 2000.0f;
data2 = 0.0001f;
while(1)
{
data1 = data1 + data2;
printf("Loop Counter %d , Data %f\n",loopCounter,data1);
loopCounter++;
}
return 0;
}
I am running this code on Linux machine using the GCC compiler but if the addition of the 2 float reaches the value 2048.0
it does not change anymore.
Does anyone have an idea why this is happening?