/* 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) */
#include <stdio.h>

const int REP = 1000000000;
const float DF = 0.01f;
const double DD = 0.01;

int main()
{
    int i, n;
    float xf;
    double xd;
    n = 0;
    xf = 0;
    for(i = 0; i < REP; i++)
    {
        n++;
        xf += DF;
    }
    printf("C (x86-64) float says %d x %.2f = %.2f\n", n, DF, xf);
    n = 0;
    xd = 0;
    for(i = 0; i < REP; i++)
    {
        n++;
        xd += DD;
    }
    printf("C (x86-64) double says %d x %.2f = %.2f\n", n, DD, xd);
    return 0;
}
