Definition:Absolute Value

Let $$x$$ be a number.

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

$$ \left|{x}\right| = \begin{cases} x & : x > 0 \\ 0 & : x = 0 \\ -x & : x < 0 \end{cases} $$

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

It applies to the various number classes as follows:


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

This is sometimes called the modulus or magnitude of $$x$$, but note that modulus has a more specialised definition in the domain of complex numbers (see above).