#include #include int main(void) { // Both these numbers have 6 significant digits, so they can be // stored accurately in a float: float f = 3.14159f; float g = 0.00000265358f; printf("%.5f\n", f); // 3.14159 -- correct! printf("%.11f\n", g); // 0.00000265358 -- correct! // Now add them up f += g; // 3.14159265358 is what f _should_ be printf("%.11f\n", f); // 3.14159274101 -- wrong! }