Advertisement

Absolute value

From Academic Kids

The graph of the absolute value function
The graph of the absolute value function

In mathematics, the absolute value (or modulus) of a real number is its numerical value without regard to its sign. So, for example, 3 is the absolute value of both 3 and −3, and 0 is the only absolute value of 0.

Contents

Definition

It can be defined as follows: For any real number a, the absolute value of a, denoted |a|, is equal to a if a ≥ 0, and to −a, if a < 0 (see also: inequality). |a| is never negative, as absolute values are always either positive or zero. Put another way, |a| < 0 has no solution for a. Also, it is not necessary that |-a| = a since a can be negative.

The absolute value can be regarded as the distance of a number from zero; indeed the notion of distance in mathematics is a generalisation of the properties of the absolute value. When real numbers are considered as one-dimensional vectors, the absolute value is the magnitude, and the p-norm for any p. Up to a constant factor, every norm in R1 is equal to the absolute value: ||x||=||1||.|x|

Properties

The absolute value has the following properties:

  1. |a| ≥ 0
  2. |a| = 0 iff a = 0.
  3. |ab| = |a||b|
  4. |a/b| = |a| / |b| (if b ≠ 0)
  5. |a+b| ≤ |a| + |b| (the triangle inequality)
  6. |ab| ≥ ||a| − |b||
  7. <math>\left| a \right| = \sqrt{a^2}<math>
  8. |a| ≤ b iff −bab
  9. |a| ≥ b iff a ≤ −b or ba

The last two properties are often used in solving inequalities; for example:

|x − 3| ≤ 9
−9 ≤ x−3 ≤ 9
−6 ≤ x ≤ 12

For real arguments, the absolute value function f(x) = |x| is continuous everywhere and differentiable everywhere except for x = 0. For complex arguments, the function is continuous everywhere but differentiable nowhere (One way to see this is to show that it does not obey the Cauchy-Riemann equations).

For a complex number z = a + ib, one defines the absolute value or modulus to be |z| = √(a2 + b2) = √ (z z*) (see square root and complex conjugate). This notion of absolute value shares the properties 1-6 from above. If one interprets z as a point in the plane, then |z| is the distance of z to the origin.

It is useful to think of the expression |xy| as the distance between the two numbers x and y (on the real number line if x and y are real, and in the complex plane if x and y are complex). By using this notion of distance, both the set of real numbers and the set of complex numbers become metric spaces.

The function is not invertible, because a negative and a positive number have the same absolute value.

Absolute value of complex numbers

The absolute value, also called modulus, of a complex number <math>c\in\mathbb C<math> is given by <math>|c| = \sqrt{c\,\overline c}<math>, where <math>\overline c<math> is its complex conjugate. Writing <math>c = a + b\,i<math> with <math>a, b\in\mathbb R<math>, this becomes <math>|c| = \sqrt{a^2 + b^2}<math>.

Like the absolute value of real numbers, this is a special case of the norm in an inner product space. It is identical to the Euclidean norm, if the complex plane is identified with the Euclidean plane R2.

Absolute value of vectors

The absolute value of a vector v, (x1, x2,..., xn), is given by

<math>\left | \mbox{v} \right | = \sqrt{x_1^2 + x_2^2 + ... + x_n^2}<math>

Note that |v| is also the length of the vector v.

Algorithm

In the C programming language, the abs(), labs(), llabs() (in C99), fabs(), fabsf(), and fabsl() functions compute the absolute value of an operand. Coding the integer version of the function is trivial, ignoring the boundary case where the largest negative integer is input:

int abs(int i)
{
    if (i < 0)
        return -i;
    else
        return i;
}

The floating-point versions are trickier, as they have to contend with special codes for infinity and not-a-numbers.

Using assembly language, it is possible to take the absolute value of a register in just three instructions (example shown for a 32-bit register on an x86 architecture, Intel syntax):

cdq
xor eax, edx
sub eax, edx

cdq extends the sign bit of eax into edx. If eax is nonnegative, then edx becomes zero, and the latter two instructions have no effect, leaving eax unchanged. If eax is negative, then edx becomes 0xFFFFFFFF, or -1. The next two instructions then become a two's complement inversion, giving the absolute value of the negative value in eax.de:Absoluter Betrag es:Valor absoluto fi:Itseisarvo fr:Valeur absolue gl:Valor absoluto is:Algildi it:Valore assoluto he:ערך מוחלט nl:Absolute waarde ja:絶対値 pl:Wartość bezwzględna ru:Абсолютная величина sl:Absolutna vrednost sv:Absolutbelopp zh:绝对值 th:ค่าสัมบูรณ์ sr:Апсолутна вредност

Navigation

Academic Kids Menu

  • Art and Cultures
    • Art (http://www.academickids.com/encyclopedia/index.php/Art)
    • Architecture (http://www.academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (http://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (http://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools