DelphiBasics
Div
Keyword
Performs integer division, discarding the remainder
  Dividend Div Divisor
Description
The Div keyword gives the whole number result of dividing the Dividend by the Divisor.
 
Any remainder is discarded.
Related commands
Mod Performs integer division, returning the remainder
 Download this web site as a Windows program.
 
Example code : A simple example
var
  int : Integer;

begin
  // Divide a primary integer by 2 - it discards the remainder
  int := 17 Div 2;

  ShowMessage('17 div 2 = '+IntToStr(int));
end;
Show full unit code
   17 div 2 = 8
 
 
Delphi Programming Neil Moffatt 2002 - 2013. All rights reserved.  |  Contact the author  |  Home Page