| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
function Round (x: Real): Integer; |
`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).
`Round' is defined in ISO-7185 Pascal and supported by all known Pascal variants.
program RoundDemo;
var
Foo: Real;
begin
foo := 9.876543;
WriteLn (Round (Foo)); { Prints 10 }
foo := 3.456789;
WriteLn (Round (Foo)) { Prints 3 }
end.
|
section 9.236 Round