#include void printStar(){ int i; for (i = 0; i < 50; i++) putchar('*'); printf("\n\n"); } int main(){ float x, y, z, z1, y1; x = 0.01; printf("\n\n"); printStar(); if (x * 100.0 != 1.0) printf("0.01 * 100.0 is %10.10f !!\n\n", x * 100.0); else printf("Some systems do the right thing.\n\n"); // Another surprising result x = 77777.0; y = 7.0; y1 = 1 / y; z = x / y; z1 = x * y1; printStar(); printf("z = 77777.0 / 7.0 \n"); printf("y1 = 1 / 7.0 \n"); printf("z1 = 77777.0 / y1 \n\n"); printf("z is %10.10f and z1 is %10.10f\n\n", z, z1); if (z != z1) printf("Hey, they're not equal! 1/7.0 cannot be represented in binary. \n\n"); else printf("Of course they're euqal!\n\n"); // A problem with significant digits x = 1000.2; y = x - 1000.0; printStar(); printf("1000.2 - 1000.0 = %10.10f\n\n", y); printStar(); return(0); }