Field-Map Scripting

4.1.3.1.22 Floor

Floor function



Prototype:

function Floor(X: double): integer;

Description:

The Floor function returns the highest integer less than or equal to X. Rounds variable toward negative infinity. The opposite function to function Ceil.

Syntax:

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


Part

Description


variable

A variable declared as integer


X

The unrounded value as a double

Return value:

The heighest integer less than or equal to the input value




Example:


var

 x : extended;

 i : integer;


begin

 x:= 1.83042;

 i:= Floor(x);

 ShowMessage(IntToStr(i));

end.

// Next examples: Floor(-3.8) = -4

//                      Floor(-3.1) = -4

//                      Floor(-2.0) = -2

//                      Floor(1.1)  =  1



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