Commodore Banner Exchange

Some properties of the absolute value function

Some properties of the absolute value function are as follows.

1.     |a| = 0 <==> a = 0;

2.     |a| = |-a|

3.     |a * b| = |a| * |b|

4.     |a| <= b <==> a <= b or a <= -b
                <==>   -b  <= a <= b

5.     |a| >= b <==> a >=b or a <= -b

 

Properties 1 and 2 are quite obvious.

Property number 3  can be useful when optimizing programs. ABS(x) * ABS(y) is in fact slower than ABS(x*y).

Properties 4 and 5 are interesting because they can replace two tests with a single test.


Commodore Banner Exchange
Insert math as
Block
Inline
Additional settings
Formula color
Text color
#333333
Type math using LaTeX
Preview
\({}\)
Nothing to preview
Insert