# Range of a function

In mathematics, the **range of a function** may refer to either of two closely related concepts:

Given two sets X and Y, a binary relation f between X and Y is a (total) function (from X to Y) if for every x in X there is exactly one y in Y such that f relates x to y. The sets X and Y are called domain and codomain of f, respectively. The image of f is then the subset of Y consisting of only those elements y of Y such that there is at least one x in X with *f*(*x*) = *y*.

As the term "range" can have different meanings, it is considered a good practice to define it the first time it is used in a textbook or article. Older books, when they use the word "range", tend to use it to mean what is now called the codomain.^{[1]}^{[2]} More modern books, if they use the word "range" at all, generally use it to mean what is now called the image.^{[3]} To avoid any confusion, a number of modern books don't use the word "range" at all.^{[4]}