modulo
FEEL built-in function · FEEL numeric functions
modulo(dividend, divisor)
Returns the remainder of the division. The result has the sign of the divisor.
The result takes the sign of the divisor, as in floored division, not of the dividend as with the % operator in Java or JavaScript. Decimal operands work too.
Parameters
| Parameter | Type | Description |
|---|---|---|
| dividend | number | the value to divide |
| divisor | number | the divisor, must not be 0 |
Examples
modulo(12, 5)
2
Try it ↑
modulo(-12, 5)
3
Try it ↑
Edge cases and null handling
modulo(12, -5)
-3
Try it ↑
modulo(10.5, 3)
1.5
Try it ↑
modulo(10, 0)
null
Try it ↑
Part of FEEL numeric functions: a side-by-side rounding table, how FEEL number equality works, and every numeric function with its edge cases.
Related functions
Defined by the OMG DMN 1.6 specification, chapter 10.3.4 (built-in functions).