Brighton Webs Ltd.
Statistics for Energy and the Environment
Home Index About

Absolute Function

The absolute function returns the magnitude of a number.  The result is always zero or a positive number.

If you have $500 in the bank, that sum appears as +500 dollars on the statement, then something falls off your life and you end up owing the bank $500, the statement then shows -500 dollars.  In both cases, the amount of money (the magnitude) is $500, the positive sign indicates the bank can give you $500, whilst the negative one suggests they think you're going to give them $500.

A more formal example in tabular form:

x abs(x)
-5 +5
0 0
+5 +5

In graphic form:

Graph of Abolute Function

Example

The page on dispersion shows how the absolute function is used in the statistic known as the mean absolute deviation.

Notation

The vertical bars to the left and right of x in the function below are the notation for an absolute value.

abs(x)=|x|

Spreadsheets

Both MS Excel and Google Docs spreadsheet provide the absolute function, e.g.

abs(A1)

Programming Languages

Most programming languages which have a math library include the absolute function, usually in the form:

y=abs(x)

Page updated: 21-May-2009