The absolute value of a number is its magnitude or distance from the origin. Absolute value is defined in real numbers and in complex numbers.

Absolute value of a real number

The absolute value of a real number n, $ |n| $, is defined as
$ |n| = \begin{cases} n, & \mbox{if } n \ge 0 \\ -n, & \mbox{if } n < 0. \end{cases} $

Absolute value of a complex number

The absolute value of a complex number $ a + bi $ is defined as
$ |a + bi| = \sqrt{a^2 + b^2}, $ equal to the distance between the number in the complex number plane and the origin.

The definition may also be extended to vectors, where absolute value is often times called "magnitude".

Magnitude of a vector

The magnitude of a vector $ a\hat{i} + b\hat{j} + c\hat{k} + \cdots $ is defined as
$ |a\hat{i} + b\hat{j} + c\hat{k} + \cdots| = \sqrt{a^2 + b^2 + c^2 + \cdots} $, is equal to the length or magnitude of the vector in question.

Notice that magnitude is sometimes denoted with a double stroke absolute value

$ |a\hat{i} + b\hat{j} + c\hat{k} + \cdots| = ||a\hat{i} + b\hat{j} + c\hat{k} + \cdots|| $

The absolute value signs are also used in set theory to indicate a cardinality, or set size. The operation measures the magnitude of a set, or in other words, the operation counts the number of elements a set contains.

Cardinality of a set

The cardinality of a set $ A = \{0,1,2,3,a,b,c\} $ containing seven elements is defined as
$ |A| = 7 $, the number of elements in the set.

Community content is available under CC-BY-SA unless otherwise noted.