# Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
BUILT-IN WOLFRAM LANGUAGE SYMBOL

# Mod

Mod[m,n]
gives the remainder on division of m by n.

Mod[m,n,d]
uses an offset d.

## DetailsDetails

• Integer mathematical function, suitable for both symbolic and numerical manipulation.
• For integers m and n, Mod[m,n] lies between and n-1.
• Mod[m,n,1] gives a result in the range to n, suitable for use in functions such as Part. »
• Mod[m,n,d] gives a result such that and .
• The sign of Mod[m,n] is always the same as the sign of n, at least so long as m and n are both real.
• Mod[m,n] is equivalent to m-n Quotient[m,n].
• Mod[m,n,d] is equivalent to m-n Quotient[m,n,d].
• The arguments of Mod can be any numeric quantities, not necessarily integers. »
• For positive x, Mod[x,1] gives the fractional part of x.
• For exact numeric quantities, Mod internally uses numerical approximations to establish its result. This process can be affected by the setting of the global variable \$MaxExtraPrecision.
• Mod works with complex numbers, using its definition in terms of Quotient.
• Mod automatically threads over lists.

## ExamplesExamplesopen allclose all

### Basic Examples  (4)Basic Examples  (4)

Remainders mod 3:

 Out[1]=

Remainders mod 3 offset to start with 1:

 Out[1]=

Plot the sequence with fixed modulus:

 Out[1]=

Plot the sequence, varying the modulus:

 Out[1]=