[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.236 Round

Synopsis

 
function Round (x: Real): Integer;

Description

`Round' returns the nearest integer to `x'. The result is of type integer. In the case of equidistance, the result is machine-dependent (or depends on the behaviour of the processor).

Conforming to

`Round' is defined in ISO-7185 Pascal and supported by all known Pascal variants.

Example

 
program RoundDemo;
var
  Foo: Real;
begin
  foo := 9.876543;
  WriteLn (Round (Foo));  { Prints 10 }
  foo := 3.456789;
  WriteLn (Round (Foo))   { Prints 3 }
end.

See also

section 9.236 Round



This document was generated by Frank Heckenbach on May, 10 2002 using texi2html