/*
This program demonstrates imprecise representation
of floating point numbers.
Aditya Mathur. January 8, 2019.
*/
public class Inaccuracy {

    public static void main(String [] args) {
        double x = 0.0;
        System.out.println(x);
        x = x + 0.1;
        System.out.println(x);
        x = x + 0.1;
        System.out.println(x);
        x=x+0.1;
        System.out.println(x);
        for (int i=0; i<1000;i++ ){
            x=x+0.1;
        }
        System.out.println(x);
        System.out.println(1003*0.1);
    }
}
