DelphiBasics
Int
Function
The integer part of a floating point number as a float System unit
 function Int ( const Number : Extended ) : Extended;
Description
The Int function returns the integer part of a floating point number as a floating point number.
Notes
The Trunc function does the same, but returns the integer in an Integer value.
Related commands
Frac The fractional part of a floating point number
Round Rounds a floating point number to an integer
Trunc The integer part of a floating point number
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 Download this web site as a Windows program.




 
Example code : A simple example
begin
  ShowMessage('Round(12.75) = '+IntToStr(Round(12.75)));
  ShowMessage('Trunc(12.75) = '+IntToStr(Trunc(12.75)));
  ShowMessage('  Int(12.75) = '+FloatToStr(Int(12.75)));
  ShowMessage(' Frac(12.75) = '+FloatToStr(Frac(12.75)));
end;
Show full unit code
   Round(12.75) = 13
   Trunc(12.75) = 12
     Int(12.75) = 12
   Frac(12.75) = 0.75
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Home Page