Main Content

Integer division with rounding option

divides each element of `C`

= idivide(`A`

,`B`

)`A`

by the corresponding element of
`B`

, rounded to the nearest integers toward zero. `A`

and `B`

must contain real numbers and at least one of them must belong to
an integer class.

If

`A`

and`B`

are arrays, then they must belong to the same integer class and have sizes that are compatible.If

`A`

or`B`

is a scalar double, then the other input must be an integer class, but not`int64`

or`uint64`

. The`idivide`

function then returns`C`

as the same integer class.

The function

`idivide(A,B,'round')`

is the same as`A./B`

and`B.\A`

for integer data types. The argument`opt`

provides the rounding options for`A./B`

and`B.\A`

when dividing integers.MATLAB

^{®}does not support complex integer division.