Field-Map Scripting

4.1.3.1.23 Ceil

Ceil function



Prototype:

function Ceil(X: double): integer;

Description:

The Ceil function returns the lowest integer greater than or equal to X. Rounds variable toward positive infinity. The opposite function to function Floor.

Syntax:

Ceil(X); / variable:= Ceil(X);


Part

Description


variable

A variable declared as integer


X

The unrounded value as a double

Return value:

The lowest integer greater than or equal to the input value



Example:


var

 x : extended;

  i : integer;


begin

 x:= 1.243;

 i:= Ceil(x);

 ShowMessage(IntToStr(i));

end.

// Next examples: Ceil(-3.8) = -3

//                Ceil(-3.1) = -3

//                Ceil(-2.0) = -2

//                Ceil(1.8)  =  2



Output in Field-Map Data Collector:


See also:

Power; Round; RoundTo, RoundVariant; Round2int, Cos; ArcCos; ArcCosH; Sin; ArcSin; ArcSinH; ArcTan; ArcTan2; ArcTanH; CosH; SinH; Tan; TanH; Random; RandomRange; Randomize; Floor; Ceil; Int; Frac; Log10; Ln; Exp; Abs; Min; Max; Odd; SecondsBetween;CompareValue; SameValue; Trunc


Example