MODULO operator
Determines the remainder after division.
Syntax
expression
An integer expression. If the expression could result in a decimal value, then that value will be rounded before the MODULO operation occurs. This may or may not produce a result that is sensible for your business logic. For code readability, such an expression should be explicitly converted to an integer expression with attention to whether or not a rounded or truncated integer is correct for your application. See the INTEGER, ROUND, and TRUNCATE functionsbase
ExampleThis procedure determines the number of trucks required to ship a given quantity of material, and how much material is left over from a less than full truck load:
NoteThe
expression
must be greater than 0 for MODULO to return a correct value.See also
OpenEdge Release 10.2B
|