Informally speaking, a step function is a piecewise constant function having only finitely many pieces.
is called a step function if it can be written as [citation needed] where
can be assumed to have the following two properties: Indeed, if that is not the case to start with, a different set of intervals can be picked for which these assumptions hold.
For example, the step function can be written as Sometimes, the intervals are required to be right-open[1] or allowed to be singleton.
[2] The condition that the collection of intervals must be finite is often dropped, especially in school mathematics,[3][4][5] though it must still be locally finite, resulting in the definition of piecewise constant functions.