To answer Steve B's question:
POSITIVE_INFINITY is the largest number you can save if you have unlimited storage space. Without this luxury, we must use a type 1.0 / 0.0 design that does an excellent job. The same goes for NEGATIVE_INFINITY, but then the largest negative number.
NaN is usually defined as 0.0 / 0.0 because there is no number like 0/0, which is ideal for NaN.
Toon krijthe
source share