IDIV() |
![]() ![]() ![]() |
The IDIV() function divides one integer by another and returns an integer result.
Format
IDIV(dividend, divisor)
where
Both arguments to the IDIV() function are converted to integers. The function returns the result of the division as an integer rounded towards zero.
A zero value of divisor will cause a run time error.
Integer division can also be performed using the // operator.
Example
X = 7 Y = 2 Z1 = X / Y Z2 = IDIV(X, Y)
This program fragment shows the difference between the division operator and the IDIV() function. Z1 will be set to 3.5 and Z2 will be set to 3.
See also: |