Definition:Absolute Value

Definition
Let $x$ be a number.

The absolute value of $x$ is denoted $\left\vert{x}\right\vert$, and is defined as follows:


 * $\left\vert{x}\right\vert = \begin{cases}

x & : x > 0 \\ 0 & : x = 0 \\ -x & : x < 0 \end{cases}$

Note that since $0 = -0$, the value of $\left\vert{x}\right\vert$ at $x = 0$ is often included in one of the other two cases, most commonly:
 * $\left\vert{x}\right\vert = \begin{cases}

x & : x \ge 0 \\ -x & : x < 0 \end{cases}$ but this can be argued as being less symmetrically aesthetic.

It applies to the various number classes as follows:


 * Natural numbers $\N$: All elements of $\N$ are greater than or equal to zero, so the concept is irrelevant.
 * Integers $\Z$: As defined here.
 * Rational numbers $\Q$: As defined here.
 * Real numbers $\R$: As defined here.
 * Complex numbers $\C$: As $\C$ is not an ordered set, the concept as defined here can not be applied. The notation $\left\vert{z}\right\vert$, where $z \in \C$, is defined as the modulus of $z$ and has a different meaning.

Ordered Integral Domain
We can go still further back, and consider the general ordered integral domain:

Also known as
The absolute value of $x$ is sometimes called the modulus or magnitude of $x$, but note that modulus has a more specialized definition in the domain of complex numbers, and that magnitude has a more specialized definition in the context of vectors.

Also see

 * Absolute Value is Functional


 * On $\Q$ and $\R$: Absolute Value is Norm


 * Even Powers are Positive: $\left\vert{x}\right\vert := +\sqrt {x^2}$