in mathematics, a piecewise function is a function whose domain is partitioned into several intervals, on which the function may be defined differently

piecewise functions can be defined using the common functional notation, with either “if” or “for” shown in the right column of each row

for example, the absolute value function is a piecewise-defined function: