/* File: if4.c Testing if statements. Using == with float has some difficulties with round off errors. */ #include int main() { float n, m, quotient ; n = 17.0 ; m = (.0000001 * 1000000) - 0.1 ; // should be zero printf("m = %.20f\n", m) ; if (m == 0.0) { // NOTE TWO = in == printf("Don't divide by zero!\n") ; } else { quotient = n / m ; printf("%f divided by %f is %f (floating point division)\n", n, m, quotient) ; } return 0 ; }