/* CS107
 * Lecture 10
 *
 * This file shows that float representation is by design
 * not infinitely precise.
 */

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

int main(int argc, char *argv[]) {
    float a = 0.1;
    float b = 0.2;
    float c = a + b;

    printf("Looks fine\n");
    printf("%f + %f = %f\n", a, b, c);
    printf("\n");

    printf("With more precision (14 places after decimal point):\n");
    printf("%.14f + %.14f = %.14f\n", a, b, c);
    return 0;
}
