In mathematics, division by zero, division where the divisor (denominator) is zero, is a unique and problematic special case. Using fraction notation, the general example can be written as
\tfraca0
a
The usual definition of the quotient in elementary arithmetic is the number which yields the dividend when multiplied by the divisor. That is,
c=\tfracab
c ⋅ b=a.
q=\tfrac{a}{0}
q ⋅ 0
0
a.
\tfrac{0}{0}
Calculus studies the behavior of functions in the limit as their input tends to some value. When a real function can be expressed as a fraction whose denominator tends to zero, the output of the function becomes arbitrarily large, and is said to "tend to infinity", a type of mathematical singularity. For example, the reciprocal function,
f(x)=\tfrac1x,
x
0.
As an alternative to the common convention of working with fields such as the real numbers and leaving division by zero undefined, it is possible to define the result of division by zero in other ways, resulting in different number systems. For example, the quotient
\tfrac{a}{0}
In computing, an error may result from an attempt to divide by zero. Depending on the context and the type of number involved, dividing by zero may evaluate to positive or negative infinity, return a special not-a-number value, or crash the program, among other possibilities.
N/D=Q
In quotitive division, the dividend
N
D
Q
The quotitive concept of division lends itself to calculation by repeated subtraction: dividing entails counting how many times the divisor can be subtracted before the dividend runs out. Because no finite number of subtractions of zero will ever exhaust a non-zero dividend, calculating division by zero in this way never terminates. Such an interminable division-by-zero algorithm is physically exhibited by some mechanical calculators.[1]
In partitive division, the dividend
N
D
Q
In another interpretation, the quotient
Q
N:D.
10:2
5:1.
5:1
10:0,
1:0,
A geometrical appearance of the division-as-ratio interpretation is the slope of a straight line in the Cartesian plane. The slope is defined to be the "rise" (change in vertical coordinate) divided by the "run" (change in horizontal coordinate) along the line. When this is written using the symmetrical ratio notation, a horizontal line has slope
0:1
1:0.
\tfrac01=0
\tfrac10
\tfrac{y}{x}
1,
1:0
Division is the inverse of multiplication, meaning that multiplying and then dividing by the same non-zero quantity, or vice versa, leaves an original quantity unchanged; for example
(5 x 3)/3={}
(5/3) x 3=5
\tfrac{6}{3}={?}
{?} x 3=6,
{?}
2,
2 x 3=6,
\tfrac63=2.
An analogous problem involving division by zero,
\tfrac{6}{0}={?},
{?} x 0=6.
{?}
When the problem is changed to
\tfrac{0}{0}={?},
\tfrac{0}{0}.
Because of these difficulties, quotients where the divisor is zero are traditionally taken to be undefined, and division by zero is not allowed.
A compelling reason for not allowing division by zero is that allowing it leads to fallacies.
When working with numbers, it is easy to identify an illegal division by zero. For example:
From
0 x 1=0
0 x 2=0
0 x 1=0 x 2.
1=2
The fallacy here arises from the assumption that it is legitimate to cancel like any other number, whereas, in fact, doing so is a form of division by .
Using algebra, it is possible to disguise a division by zero to obtain an invalid proof. For example:This is essentially the same fallacious computation as the previous numerical version, but the division by zero was obfuscated because we wrote as .
The Brāhmasphuṭasiddhānta of Brahmagupta (c. 598–668) is the earliest text to treat zero as a number in its own right and to define operations involving zero. According to Brahmagupta,
A positive or negative number when divided by zero is a fraction with the zero as denominator. Zero divided by a negative or positive number is either zero or is expressed as a fraction with zero as numerator and the finite quantity as denominator. Zero divided by zero is zero.
In 830, Mahāvīra unsuccessfully tried to correct the mistake Brahmagupta made in his book Ganita Sara Samgraha: "A number remains unchanged when divided by zero."
Bhāskara II's Līlāvatī (12th century) proposed that division by zero results in an infinite quantity,
A quantity divided by zero becomes a fraction the denominator of which is zero. This fraction is termed an infinite quantity. In this quantity consisting of that which has zero for its divisor, there is no alteration, though many may be inserted or extracted; as no change takes place in the infinite and immutable God when worlds are created or destroyed, though numerous orders of beings are absorbed or put forth.
Historically, one of the earliest recorded references to the mathematical impossibility of assigning a value to is contained in Anglo-Irish philosopher George Berkeley's criticism of infinitesimal calculus in 1734 in The Analyst ("ghosts of departed quantities").[4]
Calculus studies the behavior of functions using the concept of a limit, the value to which a function's output tends as its input tends to some specific value. The notation means that the value of the function
f
L
x
c.
f
x
c,
x,
x=c
x=c,
infty
-infty.
x
c
A basic example of an infinite singularity is the reciprocal function,
f(x)=1/x,
x
In most cases, the limit of a quotient of functions is equal to the quotient of the limits of each function separately,
However, when a function is constructed by dividing two functions whose separate limits are both equal to
0,
\tfrac00.
\tfracinftyinfty,
the separate limits of the numerator and denominator are
0
\tfrac00
The affinely extended real numbers are obtained from the real numbers
\R
+infty
-infty,
\pminfty,
1/0
1/0=+infty
The set
R\cup\{infty\}
infty
-infty=infty
a | |
0 |
=infty
a | |
infty |
=0
infty
This definition leads to many interesting results. However, the resulting algebraic structure is not a field, and should not be expected to behave like one. For example,
infty+infty
\C\cup\{infty\},
infty
This can intuitively be thought of as wrapping up the infinite edges of the complex plane and pinning them together at the single point
infty,
\hat\C=\C\cup\{infty\}.
In the extended complex numbers, for any nonzero complex number
z,
\tfrac{z}{0}=infty,
\tfrac{z}{infty}=0,
infty+0=infty,
infty+z=infty,
infty ⋅ z=infty.
\tfrac{0}{0}
\tfrac{infty}{infty}
0 ⋅ infty
The four basic operations – addition, subtraction, multiplication and division – as applied to whole numbers (positive integers), with some restrictions, in elementary arithmetic are used as a framework to support the extension of the realm of numbers to which they apply. For instance, to make it possible to subtract any whole number from another, the realm of numbers must be expanded to the entire set of integers in order to incorporate the negative integers. Similarly, to support division of any integer by any other, the realm of numbers must expand to the rational numbers. During this gradual expansion of the number system, care is taken to ensure that the "extended operations", when applied to the older numbers, do not produce different results. Loosely speaking, since division by zero has no meaning (is undefined) in the whole number setting, this remains true as the setting expands to the real or even complex numbers.
As the realm of numbers to which these operations can be applied expands there are also changes in how the operations are viewed. For instance, in the realm of integers, subtraction is no longer considered a basic operation since it can be replaced by addition of signed numbers. Similarly, when the realm of numbers expands to include the rational numbers, division is replaced by multiplication by certain rational numbers. In keeping with this change of viewpoint, the question, "Why can't we divide by zero?", becomes "Why can't a rational number have a zero denominator?". Answering this revised question precisely requires close examination of the definition of rational numbers.
In the modern approach to constructing the field of real numbers, the rational numbers appear as an intermediate step in the development that is founded on set theory. First, the natural numbers (including zero) are established on an axiomatic basis such as Peano's axiom system and then this is expanded to the ring of integers. The next step is to define the rational numbers keeping in mind that this must be done using only the sets and operations that have already been established, namely, addition, multiplication and the integers. Starting with the set of ordered pairs of integers, with, define a binary relation on this set by if and only if . This relation is shown to be an equivalence relation and its equivalence classes are then defined to be the rational numbers. It is in the formal proof that this relation is an equivalence relation that the requirement that the second coordinate is not zero is needed (for verifying transitivity).
Although division by zero cannot be sensibly defined with real numbers and integers, it is possible to consistently define it, or similar operations, in other mathematical structures.
In the hyperreal numbers, division by zero is still impossible, but division by non-zero infinitesimals is possible. The same holds true in the surreal numbers.
In distribution theory one can extend the function to a distribution on the whole space of real numbers (in effect by using Cauchy principal values). It does not, however, make sense to ask for a "value" of this distribution at x = 0; a sophisticated answer refers to the singular support of the distribution.
In matrix algebra, square or rectangular blocks of numbers are manipulated as though they were numbers themselves: matrices can be added and multiplied, and in some cases, a version of division also exists. Dividing by a matrix means, more precisely, multiplying by its inverse. Not all matrices have inverses. For example, a matrix containing only zeros is not invertible.
One can define a pseudo-division, by setting a/b = ab+, in which b+ represents the pseudoinverse of b. It can be proven that if b−1 exists, then b+ = b−1. If b equals 0, then b+ = 0.
In abstract algebra, the integers, the rational numbers, the real numbers, and the complex numbers can be abstracted to more general algebraic structures, such as a commutative ring, which is a mathematical structure where addition, subtraction, and multiplication behave as they do in the more familiar number systems, but division may not be defined. Adjoining a multiplicative inverses to a commutative ring is called localization. However, the localization of every commutative ring at zero is the trivial ring, where
0=1
Nevertheless, any number system that forms a commutative ring can be extended to a structure called a wheel in which division by zero is always possible. However, the resulting mathematical structure is no longer a commutative ring, as multiplication no longer distributes over addition. Furthermore, in a wheel, division of an element by itself no longer results in the multiplicative identity element
1
The concepts applied to standard arithmetic are similar to those in more general algebraic structures, such as rings and fields. In a field, every nonzero element is invertible under multiplication; as above, division poses problems only when attempting to divide by zero. This is likewise true in a skew field (which for this reason is called a division ring). However, in other rings, division by nonzero elements may also pose problems. For example, the ring Z/6Z of integers mod 6. The meaning of the expression should be the solution x of the equation
2x=2
In field theory, the expression is only shorthand for the formal expression ab−1, where b−1 is the multiplicative inverse of b. Since the field axioms only guarantee the existence of such inverses for nonzero elements, this expression has no meaning when b is zero. Modern texts, that define fields as a special type of ring, include the axiom for fields (or its equivalent) so that the zero ring is excluded from being a field. In the zero ring, division by zero is possible, which shows that the other field axioms are not sufficient to exclude division by zero in a field.
In computing, most numerical calculations are done with floating-point arithmetic, which since the 1980s has been standardized by the IEEE 754 specification. In IEEE floating-point arithmetic, numbers are represented using a sign (positive or negative), a fixed-precision significand and an integer exponent. Numbers whose exponent is too large to represent instead "overflow" to positive or negative infinity (+∞ or −∞), while numbers whose exponent is too small to represent instead "underflow" to positive or negative zero (+0 or −0). A NaN (not a number) value represents undefined results.
In IEEE arithmetic, division of 0/0 or ∞/∞ results in NaN, but otherwise division always produces a well-defined result. Dividing any non-zero number by positive zero (+0) results in an infinity of the same sign as the dividend. Dividing any non-zero number by negative zero (−0) results in an infinity of the opposite sign as the dividend. This definition preserves the sign of the result in case of arithmetic underflow.
For example, using single-precision IEEE arithmetic, if, then x/2 underflows to −0, and dividing 1 by this result produces 1/(x/2) = −∞. The exact result −2150 is too large to represent as a single-precision number, so an infinity of the same sign is used instead to indicate overflow.
Integer division by zero is usually handled differently from floating point since there is no integer representation for the result. CPUs differ in behavior: for instance x86 processors trigger a hardware exception, while PowerPC processors silently generate an incorrect result for the division and continue, and ARM processors can either cause a hardware exception or return zero. Because of this inconsistency between platforms, the C and C++ programming languages consider the result of dividing by zero undefined behavior.[5] In typical higher-level programming languages, such as Python, an exception is raised for attempted division by zero, which can be handled in another part of the program.
Many proof assistants, such as Coq and Lean, define 1/0 = 0. This is due to the requirement that all functions are total. Such a definition does not create contradictions, as further manipulations (such as cancelling out) still require that the divisor is non-zero.[6]
N:D
\tfracND.