Definition:Modulo Operation/Modulo One
Jump to navigation
Jump to search
Definition
Let $x, y \in \R$ be real numbers.
Let the modulo operation $\bmod$ be defined as:
- $x \bmod y := \begin{cases} x - y \floor {\dfrac x y} & : y \ne 0 \\ x & : y = 0 \end{cases}$
Then:
- $x \bmod 1 = x - \floor x$
from which it follows directly that:
- $x = \floor x + \paren {x \bmod 1}$
Also known as
The value $x \bmod 1$ can be referred to as the fractional part of $x$, and sometimes denoted $\fractpart x$.
Also see
From Real Number minus Floor we confirm that $0 \le x \bmod 1 < 1$.
Sources
- 1997: Donald E. Knuth: The Art of Computer Programming: Volume 1: Fundamental Algorithms (3rd ed.) ... (previous) ... (next): $\S 1.2.4$: Integer Functions and Elementary Number Theory: $(4)$