[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'Math' (#rtl)

Floor

Return the largest integer smaller than or equal to argument

Declaration

Source position: math.pp line 403

function Floor(

  x: Float

):Integer;

Description

Floor returns the largest integer smaller than or equal to x. The absolute value of x should be less than maxint.

Errors

If x is larger than maxint, an overflow will occur.

See also

ceil

  

Return the lowest integer number greater than or equal to argument

Example

Program Example13;

{ Program to demonstrate the floor function. }

Uses math;

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

Documentation generated on: Jun 22 2020