|
|
|
|
|
by blm
2034 days ago
|
|
From Python: >>> import numpy as np
>>> 1 + np.Inf
inf
>>> (0 + np.Inf)/2
inf
>>>
Infinity is not a number it is a concept[1] My math teacher used to say think of infinity like a impossibly large number. An impossibly large number divided by two is still an impossibly large number[1] http://mathforum.org/dr.math/faq/faq.large.numbers.html |
|
NaN is represented by a maximal (all ones) exponent, and at least one non-zero in the mantissa. Infinity has the same exponent but an all-zero mantissa. So with a naive comparison, NaN compares greater than infinity.
If you only believe output from programming languages, javascript claims that the type of infinity is "number".