Object Pascal - Integer division: div
Integer division is a mathematical operation that can be used only for whole numbers. the result of division we get without rounding simply with leave of fraction.div
Description
par1 div par2
Input
- par1 - Any number
- par2 - Any number
Output
- Result - Numbers
Examples
Object Pascal
Integer division the possible of use:x := 250 div 8; // x=7
y := x div 3; // y=2
z := (x * 2 div y +5);// z=9
Object Pascal
Even one example in what situations we can use the operation integer division:i div $0a
27 div 3
(25 div 2 + 1) + 2
Object Pascal
Other pieces of example codes:(15123 div 70)
(1512345 div 70)
70 div 8
y:= 1025 div 8;
y:= 10250 div 8;
You can find it in the following collections: arithmetic operators
Integer division in another programming language:
Differences to: