TOPICS
Search

Mod


In many computer languages (such as FORTRAN or the Wolfram Language), the common residue of b (mod m) is written mod(b, m) (FORTRAN) or Mod[b, m] (Wolfram Language).

The function mod(m,n) is related to the floor function |_x_| by

mod(m,n)=m-n|_m/n_|
(1)
=m-n(m\n),
(2)

where m\n denotes the quotient, i.e., integer division.

Since usage concerning fractional part/value and integer part/value can be confusing, the following table gives a summary of names and notations used. Here, S&O indicates Spanier and Oldham (1987).

notationnameS&OGraham et al. Wolfram Language
[x]ceiling function--ceiling, least integerCeiling[x]
mod(m,n)congruence----Mod[m, n]
|_x_|floor functionInt(x)floor, greatest integer, integer partFloor[x]
x-|_x_|fractional valuefrac(x)fractional part or {x}SawtoothWave[x]
sgn(x)(|x|-|_|x|_|)fractional partFp(x)no nameFractionalPart[x]
sgn(x)|_|x|_|integer partIp(x)no nameIntegerPart[x]
nint(x)nearest integer function----Round[x]
m\nquotient----Quotient[m, n]

See also

Ceiling Function, Common Residue, Congruence, Fractional Part, Integer Part, Minimal Residue, Nearest Integer Function, Quotient, Residue

Related Wolfram sites

http://functions.wolfram.com/IntegerFunctions/Mod/

Explore with Wolfram|Alpha

Cite this as:

Weisstein, Eric W. "Mod." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/Mod.html

Subject classifications