Modulus Function

Summary

Returns the remainder of dividing x by n.

Syntax

mod(x,n)

Arguments

Name Description
x represent a number input
n divisor part of the expression

Usage

The modulus function returns the remainder of a division operation. The function has many applications in computer science and cycle-related problems. For example, given the input mod(5,3) the remainder of dividing 5 by 3 is 2, which is the output of the function.

Examples

The examples shown below use the divisor of 3.