Some functions use different formulas for different parts of their domain. These are called piecewise-defined functions. The absolute value, signum, and floor functions are classic examples that appear throughout mathematics, engineering, and computer science.
Quick Reference
| Function | Formula | Key property |
|---|---|---|
| Absolute value | Always nonnegative; V-shaped graph | |
| Signum | Extracts the sign of | |
| Floor / Greatest integer | = largest integer | Rounds down to nearest integer |
Piecewise-Defined Functions
A piecewise-defined function is one that uses different formulas for different subsets of its domain.
For example, the function g: ℝ → ℝ defined by
is a piecewise-defined function.
The Absolute Value Function
The absolute value function is defined by
The absolute value gives the distance of from zero on the number line. Its graph is V-shaped with vertex at the origin.

The Signum (Sign) Function
The signum function (or sign function), denoted , is defined by
The signum function extracts the sign of a real number: positive inputs give , negative inputs give , and zero gives $0$.

The Greatest Integer (Floor) Function
The greatest integer function (or floor function), denoted , is the largest integer less than or equal to . In other words, it rounds down to the nearest integer:
Examples:
Note that for negative numbers, rounding down means rounding away from zero.
- The floor function maps (all integers).
- Other notations: and .

Evaluating and Graphing Piecewise Functions
A function is defined by
Evaluate , , , and plot the graph.
Solution
Since , use the middle formula: Since , use the middle formula: Since , use the bottom formula: