(* 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 RoundUp;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  Math;

var
  x : double;
  w : word;

begin
  x := 2.1;
  writeln(x,' ',trunc(x+1),' ',round(x+0.5),' ',ceil(x));
  x := 2.0;
  writeln(x,' ',trunc(x+1),' ',round(x+0.5),' ',ceil(x));
  x := 3.1;
  writeln(x,' ',trunc(x+1),' ',round(x+0.5),' ',ceil(x));
  x := 3.0;
  writeln(x,' ',trunc(x+1),' ',round(x+0.5),' ',ceil(x));
  w := strtoint('123');
  writeln(w);
end.
