range

In mathematics, the range of a function refers to either the codomain or the image of the function, depending upon usage. The codomain is a set containing the function’s output, whereas the image is only the part of the codomain where the elements are outputs of the function. For example, the function is often described as a function from the real numbers to the real numbers, meaning that the codomain is R, but its image is the set of non-negative real numbers. Some books say that range of this function is its codomain, the set of all real numbers, reflecting that the function is real-valued. These books call the actual output of the function the image. This is the current usage for range in computer science. Other books say that the range is the function’s image, the set of non-negative real numbers, reflecting that a number can be the output of this function if and only if it is a non-negative real number. In this case, the larger set containing the range is called the codomain….