Modulo

Copied!
( 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 list results in the error "Non-empty array expected."

Attempting to compute the remainder of a division by zero results in the error "Illegal division by zero."

Parameters

Parameter Type Definition and Requirements

value

List of Numbers

A single value or a list of values.

Returns

A Number which is the modulo from the value list.

Examples

Copied!
(10, 5, 2)
0
Query metrics:
  •    bytesIn:  19

  •   bytesOut:  14

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 4ms

  •    retries:   0

is equivalent to:

Copied!
((10, 5), 2)
0
Query metrics:
  •    bytesIn:  32

  •   bytesOut:  14

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 2ms

  •    retries:   0

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!