# 0 to the power of 0

Zero to the power of zero, denoted by 00, is a mathematical expression with no agreed-upon value. The most common possibilities are 1 or leaving the expression undefined, with justifications existing for each, depending on context. In algebra and combinatorics, the generally agreed upon value is 00 = 1, whereas in mathematical analysis, the expression is sometimes left undefined. Computer programs also have differing ways of handling this expression.

## Discrete exponents[]

There are many widely used formulas having terms involving natural-number exponents that require 00 to be evaluated to 1. For example, regarding b0 as an empty product assigns it the value 1, even when b = 0. Alternatively, the combinatorial interpretation of b0 is the number of empty tuples of elements from a set with b elements; there is exactly one empty tuple, even if b = 0. Equivalently, the set-theoretic interpretation of 00 is the number of functions from the empty set to the empty set; there is exactly one such function, the empty function.

## Polynomials and power series[]

Likewise, when working with polynomials, it is convenient to define 00 as having the value 1. A polynomial is an expression of the form $a_{0}x^{0}+\cdots +a_{n}x^{n}$ where x is an indeterminate, and the coefficients $a_{n}$ are real numbers (or, more generally, elements of some ring). The set of all real polynomials in x is denoted by $\mathbb {R} [x]$ . Polynomials are added termwise, and multiplied by applying the usual rules for exponents in the indeterminate x (see Cauchy product). With these algebraic rules for manipulation, polynomials form a polynomial ring. The polynomial $x^{0}$ is the identity element of the polynomial ring, meaning that it is the (unique) element such that the product of $x^{0}$ with any polynomial $p(x)$ is just $p(x)$ . Polynomials can be evaluated by specializing the indeterminate x to be a real number. More precisely, for any given real number $x_{0}$ there is a unique unital ring homomorphism $\operatorname {ev} _{x_{0}}:\mathbb {R} [x]\to \mathbb {R}$ such that $\operatorname {ev} _{x_{0}}(x^{1})=x_{0}$ . This is called the evaluation homomorphism. Because it is a unital homomorphism, we have $\operatorname {ev} _{x_{0}}(x^{0})=1.$ That is, $x^{0}=1$ for all specializations of x to a real number (including zero).

This perspective is significant for many polynomial identities appearing in combinatorics. For example, the binomial theorem $(1+x)^{n}=\sum _{k=0}^{n}{\binom {n}{k}}x^{k}$ is not valid for x = 0 unless 00 = 1. Similarly, rings of power series require $x^{0}=1$ to be true for all specializations of x. Thus identities like ${\frac {1}{1-x}}=\sum _{n=0}^{\infty }x^{n}$ and $e^{x}=\sum _{n=0}^{\infty }{\frac {x^{n}}{n!}}$ are only true as functional identities (including at x = 0) if 00 = 1.

In differential calculus, the power rule ${\frac {d}{dx}}x^{n}=nx^{n-1}$ is not valid for n = 1 at x = 0 unless 00 = 1.

## Continuous exponents[] Plot of z = xy. The red curves (with z constant) yield different limits as (x, y) approaches (0, 0). The green curves (of finite constant slope, y = ax) all yield a limit of 1.

Limits involving algebraic operations can often be evaluated by replacing subexpressions by their limits; if the resulting expression does not determine the original limit, the expression is known as an indeterminate form. In fact, when f(t) and g(t) are real-valued functions both approaching 0 (as t approaches a real number or ±∞), with f(t) > 0, the function f(t)g(t) need not approach 1; depending on f and g, the limit of f(t)g(t) can be any non-negative real number or +∞, or it can diverge. For example, the functions below are of the form f(t)g(t) with f(t), g(t) → 0 as t → 0+ (a one-sided limit), but the limits are different:

$\lim _{t\to 0^{+}}{t}^{t}=1,\quad \lim _{t\to 0^{+}}\left(e^{-{\frac {1}{t^{2}}}}\right)^{t}=0,\quad \lim _{t\to 0^{+}}\left(e^{-{\frac {1}{t^{2}}}}\right)^{-t}=+\infty ,\quad \lim _{t\to 0^{+}}\left(e^{-{\frac {1}{t}}}\right)^{at}=e^{-a}$ .

Thus, the two-variable function xy, though continuous on the set {(x, y) : x > 0}, cannot be extended to a continuous function on $\{(x,y):x>0\}\cup \{(0,0)\}$ , no matter how one chooses to define 00. However, under certain conditions, such as when f and g are both analytic functions at zero and f is positive on the open interval (0, b) for some positive b, the limit approaching from the right is always 1.

## Complex exponents[]

In the complex domain, the function zw may be defined for nonzero z by choosing a branch of log z and defining zw as ew log z. This does not define 0w since there is no branch of log z defined at z = 0, let alone in a neighborhood of 0.

## History of differing points of view[]

The debate over the definition of $0^{0}$ has been going on at least since the early 19th century. At that time, most mathematicians agreed that $0^{0}=1$ , until in 1821 Cauchy listed $0^{0}$ along with expressions like $\textstyle {\frac {0}{0}}$ in a table of indeterminate forms. In the 1830s Guglielmo Libri Carucci dalla Sommaja published an unconvincing argument for $0^{0}=1$ , and Möbius sided with him, erroneously claiming that $\textstyle \lim _{t\to 0^{+}}f(t)^{g(t)}\;=\;1$ whenever $\textstyle \lim _{t\to 0^{+}}f(t)\;=\;\lim _{t\to 0^{+}}g(t)\;=\;0$ . A commentator who signed his name simply as "S" provided the counterexample of $\textstyle (e^{-1/t})^{t}$ , and this quieted the debate for some time. More historical details can be found in Knuth (1992).

More recent authors interpret the situation above in different ways:

• Some argue that the best value for $0^{0}$ depends on context, and hence that defining it once and for all is problematic. According to Benson (1999), "The choice whether to define $0^{0}$ is based on convenience, not on correctness. If we refrain from defining $0^{0}$ , then certain assertions become unnecessarily awkward. [...] The consensus is to use the definition $0^{0}=1$ , although there are textbooks that refrain from defining $0^{0}$ ."
• Others argue that $0^{0}$ should be defined as 1. Knuth (1992) contends strongly that $0^{0}$ "has to be 1", drawing a distinction between the value $0^{0}$ , which should equal 1 as advocated by Libri, and the limiting form $0^{0}$ (an abbreviation for a limit of $\textstyle f(x)^{g(x)}$ where $\textstyle f(x),g(x)\to 0$ ), which is necessarily an indeterminate form as listed by Cauchy: "Both Cauchy and Libri were right, but Libri and his defenders did not understand why truth was on their side." Vaughn gives several other examples of theorems whose (simplest) statements require 00 = 1 as a convention.

## Treatment on computers[]

### IEEE floating-point standard[]

The IEEE 754-2008 floating-point standard is used in the design of most floating-point libraries. It recommends a number of operations for computing a power:

• pow treats 00 as 1. If the power is an exact integer the result is the same as for pown, otherwise the result is as for powr (except for some exceptional cases).
• pown treats 00 as 1. The power must be an exact integer. The value is defined for negative bases; e.g., pown(−3,5) is −243.
• powr treats 00 as NaN (Not-a-Number – undefined). The value is also NaN for cases like powr(−3,2) where the base is less than zero. The value is defined by epower×log(base).

The pow variant is inspired by the pow function from C99, mainly for compatibility. It is useful mostly for languages with a single power function. The pown and powr variants have been introduced due to conflicting usage of the power functions and the different points of view (as stated above).

### Programming languages[]

The C and C++ standards do not specify the result of 00 (a domain error may occur), but as of C99, if the normative annex F is supported, the result is required to be 1 because there are significant applications for which this value is more useful than NaN (for instance, with discrete exponents). The Java standard, the .NET Framework method System.Math.Pow, and Python also treat 00 as 1. Some languages document that their exponentiation operation corresponds to the pow function from the C mathematical library; this is the case with Lua and Perl's ** operator (where it is explicitly mentioned that the result of 0**0 is platform-dependent).

### Mathematical and scientific software[]

APL[citation needed], R, Stata[citation needed], SageMath[citation needed], Matlab[citation needed], Magma[citation needed], GAP[citation needed], Singular[citation needed], PARI/GP, and GNU Octave[citation needed] evaluate x0 to 1. Mathematica and Macsyma[citation needed] simplify x0 to 1 even if no constraints are placed on x; however, if 00 is entered directly, it is treated as an error or indeterminate. SageMath[citation needed] does not simplify 0x. Maple[citation needed], Mathematica and PARI/GP further distinguish between integer and floating-point values: If the exponent is a zero of integer type, they return a 1 of the type of the base; exponentiation with a floating-point exponent of value zero is treated as undefined, indeterminate or error.