Roughly, a function
that holds for only a proper subset of
S. Strictly, if the subset over which it holds is
R, then
is a function. However it may be more convenient to work with
S rather than with
R. The set
U,
is nonempty, and
f has no value (or rather has the
undefined value) at points in
U;
f is then said to be
undefined on
U and
defined for all elements in the subset
R of
S, i.e. in
S but not in
U.
Partial functions arise naturally in computing. When recursive definitions of functions are given, the definition can sometimes loop for certain parameters. Definitions of functions can also give rise to overflow or exception situations. In these cases it is convenient to talk about partial functions. Compare total function.