// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class FP {
    private static final int REP = 1_000_000_000;
    public static void main(String[] args) {
        int n;
        n = 0;
        float xf = 0;
        for(int i = 0; i < REP; i++) {
            n++;
            xf += 0.01f;
        }       System.out.printf("Java says %d x 0.01 = %.2f\n", n, xf);
        n = 0;
        double xd = 0;
        for(int i = 0; i < REP; i++) {
            n++;
            xd += 0.01;
        }
        System.out.printf("Java says %d x 0.01 = %.2f\n", n, xd);
    }
}
