The Art of Interface
+49 89 8999640

Article 11 — Appendix A.1

abs — absolute value function

Category. Mathematics.

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

References. This article is a part of scientific calculator Li-L, scientific calculator Li-X, scientific calculator Li-Lc and scientific calculator Li-Xc products.

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| 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]);