(* 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) *)
program precision(input, output);

const
    REP = 1000000000;
    DF : single = 0.01;
    DD : double = 0.01;
    DC : currency = 0.01;

var
    i, n : longint;
    xf : single;
    xd : double;
    xc : currency;

begin
    n := 0;
    xf := 0;
    for i := 1 to REP do begin
        n := n + 1;
        xf := xf + DF;
    end;
    writeln('FPC single says ', n:1, ' x ', DF:1:2, ' = ', xf:1:2);
    n := 0;
    xd := 0;
    for i := 1 to REP do begin
        n := n + 1;
        xd := xd + DD;
    end;
    writeln('FPC double says ', n:1, ' x ', DD:1:2, ' = ', xd:1:2);
    n := 0;
    xc := 0;
    for i := 1 to REP do begin
        n := n + 1;
        xc := xc + DC;
    end;
    writeln('FPC currency says ', n:1, ' x ', DC:1:2, ' = ', xc:1:2);
end.
