Modulo by Constant
R2026bPerform modulo operation with a constant denominator
Libraries:
Fixed-Point Designer
Description
The Modulo by Constant block performs the modulo operation (remainder after division) with a constant denominator.
The Modulo by Constant block uses an algorithm that is functionally similar to a Barrett Reduction. The division operation is computed via a multiplication by inverse, which generally results in better performance on embedded systems.
Examples
Ports
Input
Output
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"embeddedMathLib/Modulo by Constant"
Example: add_block("embeddedMathLib/Modulo by Constant","myModel/myBlock",MakeNameUnique="on")

