/* * Small demo of floating point summation problems, I */ #include int main(void) { float x = 0.1; float y = 0.2; float z, t; z = x + y; t = z - x - y; printf("%f %f -> %g\n", x, y, t); x = 0.2; y = 0.2; z = x + y; t = z - x - y; printf("%f %f -> %g\n", x, y, t); return 0; }