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".
>>> typeof Number.POSITIVE_INFINITY
"number"