In mathematics, the **affinely extended real number system** is obtained from the real number system by adding two infinity elements: and ^{[a]} where the infinities are treated as actual numbers. It is useful in describing the algebra on infinities and the various limiting behaviors in calculus and mathematical analysis, especially in the theory of measure and integration.^{[1]} The affinely extended real number system is denoted or or ^{[2]} It is the Dedekind–MacNeille completion of the real numbers.

When the meaning is clear from context, the symbol is often written simply as ^{[2]}

It is often useful to describe the behavior of a function , as either the argument or the function value gets "infinitely large" in some sense. For example, consider the function defined by

The graph of this function has a horizontal asymptote at Geometrically, when moving increasingly farther to the right along the -axis, the value of approaches 0. This limiting behavior is similar to the limit of a function in which the real number approaches except that there is no real number to which approaches.

By adjoining the elements and to it enables a formulation of a "limit at infinity", with topological properties similar to those for

To make things completely formal, the Cauchy sequences definition of allows defining as the set of all sequences of rational numbers, such that every is associated with a corresponding for which for all The definition of can be constructed similarly.

In measure theory, it is often useful to allow sets that have infinite measure and integrals whose value may be infinite.

Such measures arise naturally out of calculus. For example, in assigning a measure to that agrees with the usual length of intervals, this measure must be larger than any finite real number. Also, when considering improper integrals, such as

the value "infinity" arises. Finally, it is often useful to consider the limit of a sequence of functions, such as

Without allowing functions to take on infinite values, such essential results as the monotone convergence theorem and the dominated convergence theorem would not make sense.

The affinely extended real number system can be turned into a totally ordered set, by defining for all With this order topology, has the desirable property of compactness: Every subset of has a supremum and an infimum^{[3]} (the infimum of the empty set is , and its supremum is ). Moreover, with this topology, is homeomorphic to the unit interval Thus the topology is metrizable, corresponding (for a given homeomorphism) to the ordinary metric on this interval. There is no metric, however, that is an extension of the ordinary metric on

In this topology, a set is a neighborhood of , if and only if it contains a set for some real number The notion of the neighborhood of can be defined similarly. Using this characterization of extended-real neighborhoods, limits with tending to or , and limits "equal" to and , reduce to the general topological definition of limits—instead of having a special definition in the real number system.

The arithmetic operations of can be partially extended to as follows:^{[2]}

For exponentiation, see Exponentiation § Limits of powers. Here, means both and while means both and

The expressions and (called indeterminate forms) are usually left undefined. These rules are modeled on the laws for infinite limits. However, in the context of probability or measure theory, is often defined as ^{[4]}

When dealing with both positive and negative extended real numbers, the expression is usually left undefined, because, although it is true that for every real nonzero sequence that converges to the reciprocal sequence is eventually contained in every neighborhood of it is *not* true that the sequence must itself converge to either or Said another way, if a continuous function achieves a zero at a certain value then it need not be the case that tends to either or in the limit as tends to This is the case for the limits of the identity function when tends to and of (for the latter function, neither nor is a limit of even if only positive values of are considered).

However, in contexts where only non-negative values are considered, it is often convenient to define For example, when working with power series, the radius of convergence of a power series with coefficients is often defined as the reciprocal of the limit-supremum of the sequence Thus, if one allows to take the value then one can use this formula regardless of whether the limit-supremum is or not.

With these definitions, is not even a semigroup, let alone a group, a ring or a field as in the case of However, it has several convenient properties:

- and are either equal or both undefined.
- and are either equal or both undefined.
- and are either equal or both undefined.
- and are either equal or both undefined
- and are equal if both are defined.
- If and if both and are defined, then
- If and and if both and are defined, then

In general, all laws of arithmetic are valid in —as long as all occurring expressions are defined.

Several functions can be continuously extended to by taking limits. For instance, one may define the extremal points of the following functions as:

Some singularities may additionally be removed. For example, the function can be continuously extended to (under *some* definitions of continuity), by setting the value to for and for and On the other hand, the function can *not* be continuously extended, because the function approaches as approaches from below, and as approaches from above.

A similar but different real-line system, the projectively extended real line, does not distinguish between and (i.e. infinity is unsigned).^{[5]} As a result, a function may have limit on the projectively extended real line, while in the affinely extended real number system, only the absolute value of the function has a limit, e.g. in the case of the function at On the other hand, and correspond on the projectively extended real line to only a limit from the right and one from the left, respectively, with the full limit only existing when the two are equal. Thus, the functions and cannot be made continuous at on the projectively extended real line.