A function whose formula is different for different values of the argument. For example:

{ -1 x is less than 0
f(x) = { 0 x = 0
{ 1 x is greater than 0

is a piecewise function that returns -1 if x is

negative, 0 if x = 0, and 1 if x is

positive (this is, incidentally, the

sign function on some

calculators and in some

programming languages).