//* Testing numerical accuracy limitations *

#include <stdio.h> int main() { float x=0.1; float y=0.5; float z=x+x+x+x+x-y; // try: double, float // for double the numebr is very close to 0 // and printing rounds it up to 0 on some compilers printf("%f\n", z ); printf("%.20f\n", z ); printf("%g\n", z ); return(0); }