On Sun, Oct 18, 2020, 6:04 PM Steven D'Aprano <steve@pearwood.info> wrote:

Oops, I messed up. (Thanks David for pointing that out.)

Yup. The below is all entirely correct. Still, as fun as transfinite set theory is, these bits of it aren't actually relevant to Python and IEEE-754.

It's enough just to note that transfinite numbers are a lot different than real numbers. Just because floats, as concrete numeric type, notionally contain two transfinites, those special numbers won't follow a lot of the rules other floats do. There are good theoretical reasons, but one just has to start by accepting that.

And no, absolutely no one is suggesting adding actual Cantorian transfinite arithmetic to Python. Of course someone could write (and has written) libraries to do interesting math of this sort, but that's way outside the core language.

On Sun, Oct 18, 2020 at 07:45:40PM +1100, Steven D'Aprano wrote:

> Each of these number systems have related, but slightly different,

> rules. For example, IEEE-754 has a single signed infinity and 2**INF is

> exactly equal to INF. But in transfinite arithmetic, 2**INF is strictly

> greater than INF (for every infinity):

>

> 2**aleph_0 < aleph_1

> 2**aleph_1 < aleph_2

> 2**aleph_2 < aleph_3

I conflated what I was thinking:

# note the change in comparison

2**aleph_0 > aleph_0

2**aleph_1 > aleph_1

2**aleph_2 > aleph_2

...

which I think is correct regardless of your position on the Continuum

Hypothesis (David, care to comment?), with this:

2**aleph_0 = aleph_1

2**aleph_1 = aleph_2

2**aleph_2 = aleph_3

...

which is only true if the Continuum Hypothesis is true, and then wrote

down something which was complete nonsense. Sorry.

--

Steve

_______________________________________________

Python-ideas mailing list -- python-ideas@python.org

To unsubscribe send an email to python-ideas-leave@python.org

https://mail.python.org/mailman3/lists/python-ideas.python.org/

Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/AENOEZNHWPYRSM7CHSU2N74A2NXF6P4O/

Code of Conduct: http://python.org/psf/codeofconduct/