Files
freeCodeCamp/guide/english/mathematics/absolute-value/index.md
2019-03-12 15:51:25 +05:30

1.7 KiB

title
title
Absolute Value

Absolute Value

Absolute value is the non-negative value of a number, whether that number is positive or negative. You can think of a number's absolute value as its distance from zero. It can be also be considered as magnitude without direction. It can be defined as,

img

The absolute value of a quantity x is denoted by |x| (the quantity is enclosed between two vertical bars). Here you can see that in the graph of y = |x|, if -2 is input in to the function, 2 is the result. This is because -2 has a distance of 2 from zero. The absolute value of a number can never be negative.

For complex numbers, this is also referred to as the modulus.

Pythagorean Theorem: If z=a+bi, where a=Re{z} and b=Im{z}, then |z|=sqrt(a^2+b^2)

i

Examples

  • Simplify |-5|

    |-5| = 5

  • Simplify |0(5)|

    |0(5)| = |0| = 0

  • Simplify -|-1|

    -|-1| = -(1) = -1

  • Simplify |-5(-3) + 1|

    |-5(-3) + 1| = |15 + 1| = |16| = 16

  • Simplify |8|

    |8| = 8

  • Simplify |(-5)^3|

|(-5)^3| = |-125| = 125

  • Simplify -|(4)^2| -|16| = -16

More Information:

Purplemath