System.Trunc
Delphi
function Trunc(X: Real): Int64;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.pas | System | System |
Description
Truncates a real number to an integer.
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.
Note: Please consider checking the Floating-Point Rounding Routines topic for more insight on rounding routines.
See Also
- System.Int
- System.Round
- System.Math.Floor
- System.Math.Ceil
- Delphi Intrinsic Routines
- Mathematical Routines
Code Examples