# Limit of Modulo Operation

Jump to navigation
Jump to search

## Contents

## Theorem

Let $x$ and $y$ be real numbers.

Let $x \bmod y$ denote the modulo operation.

Then holding $x$ fixed gives:

- $\displaystyle \lim_{y \mathop \to 0} x \bmod y = 0$

- $\displaystyle \lim_{y \mathop \to \infty} x \bmod y = x$ if $x \ge 0$

## Proof

### Limit 1

By Range of Modulo Operation for Positive Modulus and Range of Modulo Operation for Negative Modulus we have:

- $- \size y \lt x \bmod y \lt \size y$

The result follows from the Squeeze Theorem.

$\blacksquare$

### Limit 2

As $y \to \infty$:

\(\displaystyle 0\) | \(\le\) | \(\, \displaystyle x \, \) | \(\, \displaystyle <\, \) | \(\displaystyle y\) | |||||||||

\(\displaystyle \leadsto \ \ \) | \(\displaystyle 0\) | \(\le\) | \(\, \displaystyle \frac x y \, \) | \(\, \displaystyle <\, \) | \(\displaystyle 1\) | ||||||||

\(\displaystyle \leadsto \ \ \) | \(\displaystyle \) | \(\) | \(\, \displaystyle \floor {\frac x y} \, \) | \(\, \displaystyle =\, \) | \(\displaystyle 0\) |

Therefore by the definition of modulo operation:

\(\displaystyle \lim_{y \mathop \to \infty} x \bmod y\) | \(=\) | \(\displaystyle \lim_{y \mathop \to \infty} x - y \floor {\dfrac x y}\) | |||||||||||

\(\displaystyle \) | \(=\) | \(\displaystyle \lim_{y \mathop \to \infty} x - y \cdot 0\) | |||||||||||

\(\displaystyle \) | \(=\) | \(\displaystyle x\) |

Hence the result.

$\blacksquare$