idivide
Integer division with rounding option.
📝Syntax
C = idivide(A, B)
C = idivide(A, B, opt)
📥Input Arguments
Parameter Description
A, B integer arrays (at least one must be of an integer class).
opt rounding rule: 'fix' (default), 'round', 'floor' or 'ceil'.
📤Output Arguments
Parameter Description
C integer division result.
📄Description

idivide(A, B) divides A by B and rounds the result toward zero ('fix'), keeping the integer class of the inputs.

Use opt to select another rounding rule: 'round', 'floor' or 'ceil'.

💡Examples
idivide(int32(7), int32(2))
idivide(int32(7), int32(2), 'ceil')
🔗See Also
modrem
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub