Описание тега infinity
Infinity is a specific floating point value that is always larger than any other floating point value. It may arise as a result of division by zero, arithmetic overflow and other exceptional operations. Infinity is different from the maximal still valid floating point value that the certain data type can hold.
IEEE 754 floating point standard allows both positive and negative infinity values.
Infinity is a specific floating point value that is always larger than any other floating point value. It may arise as a result of division by zero, arithmetic overflow and other exceptional operations. IEEE 754 floating point standard allows both positive and negative infinity values.
Infinity is different from the maximal still valid floating point value that the certain data type can hold. This value is still smaller than the infinity.
Some programming languages allow to specify the infinity in the code explicitly. For instance, the Java code
double [] values = ...
double min = Double.POSITIVE_INFINITY;
for (double x: values)
if (x < min) min = x;
can be used to obtain the minimal value in the array that only contains usual, valid floating point values.