absolute value
In mathematics, the absolute value or modulus of a real number is its distance from zero. It is usually denoted by |x|, where x is the real number. For example, the absolute value of 5 is 5, and the absolute value of -5 is also 5.
The absolute value of a number is always non-negative. If x is positive, then |x| = x. If x is negative, then |x| = -x.
The absolute value of a number has a number of properties, including:
- |x| >= 0 for all real numbers x.
- |x| = x if x >= 0.
- |x| = -x if x < 0.
- |x + y| <= |x| + |y| for all real numbers x and y.
- |x – y| = |y – x| for all real numbers x and y.
The absolute value of a number is used in a variety of mathematical applications, including:
- Calculating distances
- Solving inequalities
- Proving mathematical theorems
- Analyzing data
In computer science, the absolute value of a number is used in a variety of applications, including:
- Calculating distances between points
- Solving inequalities in computer programs
- Proving mathematical theorems in computer programs
- Analyzing data in computer programs
