Re:How do you compute the midpoint of an interval? (2014) [pdf]
by thaumasiotes on Friday March 29, 2019 @10:55AM
(#19522218)
Is a == -b true when a and b are +inf and -inf? That's not what I would have expected.
Re:How do you compute the midpoint of an interval? (2014) [pdf]
by jacobolus on Friday March 29, 2019 @01:11PM
(#19523555)
You are asking if ∞ == ∞? Yes.
Re:How do you compute the midpoint of an interval? (2014) [pdf]
by wutbrodo on Friday March 29, 2019 @01:23PM
(#19523672)
It's been years since I got my math degree, but IIRC this isn't true. At least, it's not true in enough framings that you can assert it this plainly. Infinity isn't just another number, and just because the symbols are identical in either side of the equals signs doesn't mean the entities described are.
Re:How do you compute the midpoint of an interval? (2014) [pdf]
by jacobolus on Friday March 29, 2019 @01:27PM
(#19523717)
We are talking about the floating point number format and the behavior of computer programming languages.
In “mathematics”, the meaning of the symbol ∞ depends on what number system we are talking about. In some contexts ∞ is not a “number”, but rather a shorthand for a statement about limits. In other contexts it is a number.
If you want to learn about the “affinely extended real numbers”, which is what floating point numbers more or less approximate, you can read https://en.wikipedia.org/wiki/Extended_real_number_line
That, IMO, is debatable. NaN is an option, too (as it is for the case a=+∞, b=-∞, so one can argue ”0 if a == –b” needs tuning, too)
Both choices break the property m(I) ∈ I, but that may be fine, as NaN doesn’t mean the midpoint isn’t in the interval, but just that one cannot tell where in the interval it lies.