Indeterminate and Infinite Results

If you type in an expression like , the Wolfram Language prints a message, and returns the result Indeterminate.
In[1]:=
Click for copyable input
Out[1]=

An expression like is an example of an indeterminate numerical result. If you type in , there is no way for the Wolfram Language to know what answer you want. If you got by taking the limit of as , then you might want the answer . On the other hand, if you got instead as the limit of , then you probably want the answer . The expression on its own does not contain enough information to choose between these and other cases. As a result, its value must be considered indeterminate.

Whenever an indeterminate result is produced in an arithmetic computation, the Wolfram Language prints a warning message, and then returns Indeterminate as the result of the computation. If you ever try to use Indeterminate in an arithmetic computation, you always get the result Indeterminate. A single indeterminate expression effectively "poisons" any arithmetic computation. (The symbol Indeterminate plays a role in the Wolfram Language similar to the "not a number" object in the IEEE Floating Point Standard.)

The usual laws of arithmetic simplification are suspended in the case of Indeterminate.
In[2]:=
Click for copyable input
Out[2]=
Indeterminate "poisons" any arithmetic computation, and leads to an indeterminate result.
In[3]:=
Click for copyable input
Out[3]=

When you do arithmetic computations inside Wolfram Language programs, it is often important to be able to tell whether indeterminate results were generated in the computations. You can do this by using the function Check discussed in "Messages" to test whether any warning messages associated with indeterminate results were produced.

You can use Check inside a program to test whether warning messages are generated in a computation.
In[4]:=
Click for copyable input
Out[4]=
Indeterminatean indeterminate numerical result
Infinitya positive infinite quantity
-Infinitya negative infinite quantity (DirectedInfinity[-1])
DirectedInfinity[r]an infinite quantity with complex direction r
ComplexInfinityan infinite quantity with an undetermined direction
DirectedInfinity[]equivalent to ComplexInfinity

Indeterminate and infinite quantities.

There are many situations where it is convenient to be able to do calculations with infinite quantities. The symbol Infinity in the Wolfram Language represents a positive infinite quantity. You can use it to specify such things as limits of sums and integrals. You can also do some arithmetic calculations with it.

Here is an integral with an infinite limit.
In[5]:=
Click for copyable input
Out[5]=
The Wolfram Language knows that .
In[6]:=
Click for copyable input
Out[6]=
If you try to find the difference between two infinite quantities, you get an indeterminate result.
In[7]:=
Click for copyable input
Out[7]=

There are a number of subtle points that arise in handling infinite quantities. One of them concerns the "direction" of an infinite quantity. When you do an infinite integral, you typically think of performing the integration along a path in the complex plane that goes to infinity in some direction. In this case, it is important to distinguish different versions of infinity that correspond to different directions in the complex plane. and are two examples, but for some purposes one also needs and so on.

In the Wolfram Language, infinite quantities can have a "direction", specified by a complex number. When you type in the symbol Infinity, representing a positive infinite quantity, this is converted internally to the form DirectedInfinity[1], which represents an infinite quantity in the direction. Similarly, -Infinity becomes DirectedInfinity[-1], and IInfinity becomes DirectedInfinity[I]. Although the DirectedInfinity form is always used internally, the standard output format for DirectedInfinity[r] is r Infinity.

Infinity is converted internally to DirectedInfinity[1].
In[8]:=
Click for copyable input
Out[8]//FullForm=

Although the notion of a "directed infinity" is often useful, it is not always available. If you type in , you get an infinite result, but there is no way to determine the "direction" of the infinity. The Wolfram Language represents the result of as DirectedInfinity[]. In standard output form, this undirected infinity is printed out as ComplexInfinity.

gives an undirected form of infinity.
In[9]:=
Click for copyable input
Out[9]=