Qu

mod

Builtin index · Collections & strings

result = a mod b

Input: no input · Output: result

What it is

a/b are numbers.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = a mod bno input
result number
Returns a number: the remainder with the sign of the divisor, so -1 mod 3 is 2 rather than -1. A keyword, not a function.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

n mod 2 == 0        # correct

mod(n, 2)           # parse error: unexpected Keyword("mod") in expression

from agent-guide