RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Math.DivMod Function

Returns the result of an integer division, including the remainder.

Pascal
procedure DivMod(Dividend: Cardinal; Divisor: Word; var Result: Word; var Remainder: Word);
C++
DivMod(unsigned Dividend, Word Divisor, Word Result, Word Remainder);

Math

Call DivMod to perform 16-bit integer division and fetch the remainder as well, all in one operation. 

Dividend is the integer into which you are dividing. 

Divisor is the value by which to divide Dividend. 

Result returns the result of the integer division. 

Remainder returns the remainder (the difference between Result * Divisor and Dividend). 

 

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