The rule
|x| = x if x ≥ 0, −x if x < 0
Why it works
Absolute value strips the sign and leaves the magnitude. Geometrically it is the distance from zero on the number line, and that reading is the one that generalises: |a − b| is the distance between a and b.
How to do it by hand
- If the number is positive or zero, leave it alone
- If it is negative, change the sign
- For the distance between two numbers, subtract and take the absolute value
- The result is never negative
What is worth knowing
Reading it as distance is what makes absolute value useful rather than fussy. |x − 3| < 2 says 'x is within 2 of 3', which is an interval, and that is exactly how limits and error bounds are written throughout analysis. The same idea extends: the modulus of a complex number is its distance from the origin, and the magnitude of a vector is the same notion in more dimensions. The one thing to watch is that |a + b| is not |a| + |b| — it can only be less or equal, which is the triangle inequality.