Sign in Join
FPDoc Onlineexperiment

Ceil function

In unit Math

Return the lowest integer number greater than or equal to argument.

Declaration

pascal
function Ceil(x: Float): Integer

Description

Ceil returns the lowest integer number greater than or equal to x. The absolute value of x should be less than maxint.

Errors

If the absolute value of x is larger than maxint, an overflow error will occur.

See also

Example: ex7

pascal
Program Example7;

{ Program to demonstrate the Ceil function. }

Uses math;

begin
  Writeln(Ceil(-3.7)); // should be -3
  Writeln(Ceil(3.7));  // should be 4
  Writeln(Ceil(-4.0)); // should be -4
end.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.