1. Computing
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

Int

unit
System
category
arithmetic routines

declaration
function Int(X: Extended): Extended

description
Returns the integer part of a number.

Int(X) = X - Frac(X).

example
var x1,x2 : extended;
	
x1 := -2,123;
x2 := 4.987;

x1 := Int(x1);
x2 := Int(x2);

//x1 = -2.0
//x2 = 4.0

in real code

see also
Frac, Round,


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

©2013 About.com. All rights reserved.