The absolute value of a real number x, often written |x| in mathematics or abs(x) in various programming languages is x if x>=0, and -x if x < 0.

The magnitude of a real number, disregarding its positive or negative sign: the absolute value of -4 or +4, written |-4| or |+4|, is 4.

The absolute value of a complex number z=(r,i) is |z| or abs(z), and can be found using good old trigonometry: |z| = sqrt(r2 + i2)

The absolute value of an n-dimentional vector v = (x1, x2, ... , xn) can similarly be found thus: |v| = sqrt(x12 + x22 + ... + xn2)

In simple terms, the absolute value of a number is its "distance" from the number .

With real numbers, this is quite simple, but when you have the "2-dimensionality" of a complex number (represented as a + bi, where ii=-1), you must use the pythagorean theorem to find the hypotenuse, which is the distance from 0.

|a + bi| = sqrt(aa + bb)

Log in or register to write something here or to contact authors.