/* CS107
 * Lecture 10
 *
 * This file shows more of the pitfalls with performing
 * float arithmetic.
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[]) {
    float a = 3.14;
    float b = 1e20;

    float c = b - 1;

    printf("(3.14 + 1e20) - 1e20 = %g\n", (a + b) - b);
    printf("3.14 + (1e20 - 1e20) = %g\n", a + (b - b));

    printf("c = %g\n", c);
    return 0;
}
