For questions about or involving the absolute value function also known as modulus function.

The absolute value function, usually denoted by $|x|$, is a function $\mathbb{R} \to [0, \infty)$ which can be defined in three equivalent ways:

$|x| = \begin{cases}x &\ \text{if $x \ge 0$, and} \\ -x &\ \text{if $x < 0$.} \end{cases}$

$|x| = \sqrt{x^2}$, and

$|x| = \max \{x, -x\}$.

This definition extends to complex numbers as the square root of the norm: $|x+iy|=\sqrt{x^2+y^2}$. In both cases, the function may be interpreted geometrically as the distance of the input number from the origin.

More generally, an absolute value may be defined on an field (or integral domain) $k$ as a function $|\cdot | : k \to \mathbb{R}$ which satisfies the axioms

(nonnegativity) $|x| \ge 0$ for all $x \in k$,

(definiteness) $|x| = 0 \iff x = 0 \in k$,

(multiplicativity) $|x y| = |x||y| $ for all $x,y\in k$ ), and

(triangle inequality) $|x+y| \le |x| + |y|$ for all $x,y\in k$.

For example, if $p$ is a fixed prime number and $x \in \mathbb{Q}$, then there exists a unique $n \in \mathbb{Z}$ such that $x$ may be written as $$ x = p^n \frac{a}{b}, $$ where $\gcd(p, a) = \gcd(p, b) = 1$. The function which maps $x$ to $p^{-n}$ is an absolute value on $\mathbb{Q}$, called the $p$-adic absolute value.