Why?
11979999 / 10000 = 1197.999877930
With
printf("%f\n", static_cast<double>(((float)11979999 / (float)10000)));
Instead of
1197.9999
And how to fix it?
Why?
11979999 / 10000 = 1197.999877930
With
printf("%f\n", static_cast<double>(((float)11979999 / (float)10000)));
Instead of
1197.9999
And how to fix it?
In your code you did the calculation in single precision, then you converted the result to double. If you want double precision, do the calculation in double precision:
printf("%f\n", (double)11979999 / (double)10000);