Modulo
Modulo( value_1, value_2, ... )
Description
The Modulo
function computes the remainder after division on a list of
numbers. Providing a single operand returns the operand.
Attempting to call modulo with an empty array results in the error "Non-empty array expected." Check to make sure at least one argument is passed to modulo function.
Attempting to compute the remainder of a division by zero results in the error "Illegal division by zero."
Parameters
Argument | Type | Definition and Requirements |
---|---|---|
|
List of Numbers |
A single value or a list of values. |
Examples
client.query(q.Modulo(10, 5, 2))
.then((ret) => console.log(ret))
is equivalent to:
client.query(q.Modulo(q.Modulo(10, 5), 2))
.then((ret) => console.log(ret))
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!