5.26. MOD¶

Purpose
Computes the modulo of a number for a given divisor.
Procedure
The MOD component returns the remainder when the input value is divided by a specified divisor:
(5.26.1)¶\[y = x - floor(x/c) \cdot c\]
where x is the input signal, c is the divisor, and floor(x/c) is the greatest integer less than or equal x.
Parameters
Parameter |
input |
unit |
range |
default |
remarks |
---|---|---|---|---|---|
divisor |
real |
must be non-zero |
Remarks
If a signal line is connected to the second input channel, the value of that signal line is used as divisor. Otherwise, the value specified in the component properties is used.
The result has the same sign as the divisor (See examples).
Examples
