RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System.Trunc Function

Truncates a real number to an integer.

Pascal
function Trunc(X: Extended): Int64;
C++
Int64 Trunc(Extended X);

System

In Delphi code, the Trunc function truncates a real-type value to an integer-type value. X is a real-type expression. Trunc returns an Int64 value that is the value of X rounded toward zero. 

If the truncated value of X is not within the Int64 range, an EInvalidOp exception is raised. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!