The Absolute Value Function

The absolute value function receives a number as input an outputs how far away from zero the input is. With the exception of the input zero, the output of the absolute function is always greater than zero.

In the math-world, an expression inside of vertical bars represents the absolute value function. In the computer-world, the absolute value function is sometimes named abs().

   |5| = 5        |-5| = 5
   abs(5) = 5     abs(-5) = 5

   |2 x -6| = |-12| = 12
   abs(2 x -6) = abs(-12) = 12

The following is a mathematical definition for the absolute value function.

   For any real number 'n', the absolute value of 'n' is
   written |n| and is defined as:

      |n| = n, if n >= 0
      |n| = -n, if n < 0
Exercises
  1. No or Yes: The absolute value of a number 'n' is always equal to the opposite of the number 'n'.

  2. No or Yes: 5 + -|-5| + 5 = 5^3

  3. No or Yes: If |a| ≤ b, then -b ≤ a ≤ b.

  4. No or Yes: |a + b| ≤ |a| + |b|

  5. Rewrite |ab| = |a||b| using function notation with the function name being abs().


Creator: Gerald D. Thurman [gthurman@gmail.com]
Created: 31 January 2007

Creative Commons License
This work is licensed under a Creative Commons License.