Infinity - Computing

Computing

The IEEE floating-point standard (IEEE 754) specifies the positive and negative infinity values. These are defined as the result of arithmetic overflow, division by zero, and other exceptional operations.

Some programming languages, such as Java and J, allow the programmer an explicit access to the positive and negative infinity values as language constants. These can be used as greatest and least elements, as they compare (respectively) greater than or less than all other values. They are useful as sentinel values in algorithms involving sorting, searching or windowing.

In languages that do not have greatest and least elements, but do allow overloading of relational operators, it is possible for a programmer to create the greatest and least elements. In languages that do not provide explicit access to such values from the initial state of the program, but do implement the floating point data type, the infinity values might still be accessible and usable as the result of certain operations.

Read more about this topic:  Infinity