In the hyperreal numbers and the surreal numbers, division by zero is still impossible, but division by non-zero infinitesimals is possible.
### Distribution theory

In

In distribution theory one can extend the function $\textstyle {\frac {1}{x}}$ 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.

### Linear algebra

In matrix algebra (or linear algebra in general), 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.

### Abstract algebra

Any number system that forms a commutative ring—for instance, the integers, the real numbers, and the complex numbers—can be extended to a wheel in which division by zero is always possible; however, in such a case, "division" has a slightly different meaning.^{[clarification needed]}

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 multiplicati

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**/6**Z** of integers mod 6. The meaning of the expression $\textstyle {\frac {2}{2}}$ should be the solution *x* of the equation $2x=2$. But in the ring **Z**/6**Z**, 2 is a zero divisor. This equation has two distinct solutions, *x* = 1 and *x* = 4, so the expression $\textstyle {\frac {2}{2}}$ is undefined.

In field theory, the expression $\textstyle {\frac {a}{b}}$ 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 0 ≠ 1 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.

The IEEE floating-point standard, supported by almost all modern floating-point units, specifies that every floating point arithmetic operation, including division by zero, has a well-defined result. The standard supports signed zero, as well as infinity and NaN (*not a number*). There are two zeroes: +0 (*positive zero*) and −0 (*negative zero*) and this removes any ambiguity when dividing. In IEEE 754 arithmetic, *a* ÷ +0 is positive infinity when *a* is positive, negative infinity when *a* is negative, and NaN when *a* = ±0. The infinity signs change when dividing by −0 instead.

The justification for this definition is to preserve the sign of the result in case of arithmetic underflow.^{[11]} For example, in the single-precision computation 1/(*x*/2), where *x* = ±2^{−149}, the computation *x*/2 underflows and produces ±0 with sign matching *x*, and the result will be ±∞ with sign matching *x*. The sign will match that of the exact result ±2^{150}, but the magnitude of the exact result is too large to represent, so infinity is used to indicate overflow.

Integer division by zero is usually handled differently from floating point since there is no integer representation for the result. Some processors generate an exception when an attempt is made to divide an integer by zero, although others will simply continue and generate an incorrect result for the division. The result depends on how division is implemented, and can either be zero, or sometimes the largest possible integer.

Because of the improper algebraic results of assigning any value to division by zero, many computer programming languages (including those used by calculators) explicitly forbid the execution of the operation and may prematurely halt a program that attempts it, sometimes reporting a "Divide by zero" error. In these cases, if some special behavior is desired for division by zero, the condition must be explicitly tested (for example, using an if statement). Some programs (especially those that use fixed-point arithmetic where no dedicated floating-point hardware is available) will use behavior similar to the IEEE standard, using large positive and negative numbers to approximate infinities. In some programming languages, an attempt to divide by zero results in undefined behavior. The graphical programming language arithmetic underflow.^{[11]} For example, in the single-precision computation 1/(*x*/2), where *x* = ±2^{−149}, the computation *x*/2 underflows and produces ±0 with sign matching *x*, and the result will be ±∞ with sign matching *x*. The sign will match that of the exact result ±2^{150}, but the magnitude of the exact result is too large to represent, so infinity is used to indicate overflow.

Integer division by zero is usually handled differently from floating point since there is no integer representation for the result. Some processors generate an exception when an attempt is made to divide an integer by zero, although others will simply continue and generate an incorrect result for the division. The result depends on how division is implemented, and can either be zero, or sometimes the largest possible integer.

Because of the improper algebraic results of assigning any value to division by zero, many computer programming languages (including those used by calculators) explicitly forbid the execution of the operation and may prematurely halt a program that attempts it, sometimes reporting a "Divide by zero" error. In these cases, if some special behavior is desired for division by zero, the condition must be explicitly tested (for example, using an if statement). Some programs (especially those that use fixed-point arithmetic where no dedicated floating-point hardware is available) will use behavior similar to the IEEE standard, using large positive and negative numbers to approximate infinities. In some programming languages, an attempt to divide by zero results in undefined behavior. The graphical programming language Scratch 2.0 and 3.0 used in many schools returns Infinity or −Infinity depending on the sign of the dividend.

In two's complement arithmetic, attempts to divide the smallest signed integer by −1 are attended by similar problems, and are handled with the same range of solutions, from explicit error conditions to undefined behavior.

Most calculators will either return an error or state that 1/0 is undefined; however, some TI and HP graphing calculators will evaluate (1/0)^{2} to ∞.

Microsoft Math and Mathematica return `ComplexInfinity`

for 1/0. Maple and SageMath return an error message for 1/0, and infinity for 1/0.0 (0.0 tells these systems to use floating point arithmetic instead of algebraic arithmetic).

Some modern calculators allow division by zero in special cases, where it will be useful to students and, presumably, understood in context by mathematicians. Some calculators, the online Desmos calculator is one example, allow arctangent(1/0). Students are often taught that the inverse cotangent function, arccotangent, should be calculated by taking the arctangent of the reciprocal, and so a calculator may allow arctangent(1/0), giving the output ${\tfrac {\pi }{2}}$, which is the correct value of arccotangent 0. The mathematical justification is that the limit as x goes to zero of arctangent 1/x is ${\tfrac {\pi }{2}}$.