Int

From Delphi Pascal wiki
Jump to navigation Jump to search

Returns the Integer part of the argument.

Declaration
function Int(X: Real): Real;
Target
Windows, Real, Protected
Remarks
X is a real-type expression. The result is the integer part of X; that is, X rounded toward zero.
See Also
Frac
Round
Trunc


Sample Code

{Int.PAS}
{Sample code for the Int function.}

var R: Real;
begin
 R := Int(123.456);    { 123.0 }
 R := Int(-123.456);   { -123.0 }
end.