next up previous contents index
Next: Runerror Up: Functions and Procedures Previous: Rmdir

Round

   

Declaration:

Function Round (X : real) : Longint;

Description:

Round rounds X to the closest integer, which may be bigger or smaller than X.

Errors:

None.

See also:

Frac, Int, Trunc

Example
Program Example54;

{ Program to demonstrate the Round function. }

begin
  Writeln (Round(123.456));  { Prints 124  }
  Writeln (Round(-123.456)); { Prints -124 }
  Writeln (Round(12.3456));  { Prints 12   }
  Writeln (Round(-12.3456)); { Prints -12  }
end.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998