The Art of Interface

# abs — absolute value function

Category. Mathematics.

Abstract. Absolute value: definition, graph, properties and identities.

## 1. Definition

Absolute value function is defined as

|x| = x for x ≥ 0;
|x| = −x for x < 0.

## 2. Graph

Absolute value function is defined everywhere on real axis. Its graph is depicted below — fig. 1. Fig. 1. Graph of the absolute value function y = |x|.

Function codomain is non-negative half of the real axis: [0, +∞).

## 3. Identities

Function is symmetrical:

|−x| = |x|

Sum and difference of arguments:

|x + y| = |x| + |y|, if signx = signy
|x + y| = ||x| − |y||, if signx ≠ signy
|xy| = ||x| − |y||, if signx = signy
|xy| = |x| + |y|, if signx ≠ signy

Product and ratio of arguments:

|xy| = |x||y|
|x /y| = |x| /|y|

## 4. Support

Absolute value function abs is supported in:

Absolute value function of the complex argument abs is supported in:

## 5. How to use

To calculate absolute value of the number:

``abs(-1);``

To calculate absolute value of the current result:

``abs(Rslt);``

To calculate absolute value of the number x in memory:

``abs(Mem[x]);``