Hacker News new | ask | show | jobs
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

2 comments

I'm not talking about math. I'm talking about computer numbers, specifically IEEE-754.

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"
I know you were talking about floating point. That is why I said what I said using python code. It seems to be a concrete representation of IEEE-754 math. Also from my reading and understanding numpy is written by scientists that understand IEEE-754 perhaps a little more than some others.

I was fully away of that stuff you say about how NaN is represented and was also aware of how Inf is represented. My statement and link to the concept of Infinity on mathforum was an effort to support the idea of why most math done with code involving Inf will also result in an answer of Inf.

The article that this whole discussion is about seems to think it is OK (ie not a bug) to convert a float like Inf to a integer do some math and convert back to a float and get 1.5 and that is OK. It seems like a bug to me.

While you’re correct, you’re being downvoted probably because you’re taking this seriously. I’m sure most everyone here knows infinity isn’t a number, but a concept, but you never know.
I think any conversation that says there is halfway between inf and 0 is treating inf like it is a fixed point and therefore a number and not a concept

This is why participating on Hacker News conversations are problematic. I think you are talking about downvoting because a persons misunderstands me. Even in your statement you imply by saying "but you never know" that it is possible people aren't being aware of the point I was making