On Sat, Dec 28, 2019, 11:02 PM Chris Angelico <ros...@gmail.com> wrote:

> They really truly ARE numbers. They are, in fact, these numbers:
>
> a = 3602879701896397 / 36028797018963968
> b = 3602879701896397 / 18014398509481984
> c = 5404319552844595 / 18014398509481984
>
> When you perform addition on these, the result must repeatedly be
> rounded to the available resolution. This is not about numbers, it is
> about limited subsets of numbers.
>

They really truly are NOT numbers. Numbers are not substantial things in
themselves. They are defined by forming a field under two operators, '+'
and '*'.

Often numbers are constructed, in a somewhat arbitrary way, from sets. A
successor operation is defined in terms of subset, then we prove that that
construction obeys the Peano axioms. Rationals can be constructed by
defining a ratio or division operation, and that can be shown to create a
field. Reals can be defined as Cauchy sequences of infinitely many
Rationals, and they also define a field of weirdly convoluted sets.

You can construct these numbers in other ways. For example, you can create
a FINITE field on bit-patterns of 32-bits, or 64-bits, or 42-bits, or
whatever. However, the bit patterns used for IEEE-754 "numbers" are not
ones that form a field. They are NOT NUMBERS under the meaning given to the
operations '+' and '*' by computer chips and programming languages.

Now yes, you are free to say that NOTIONALLY you want to think of the bit
pattern created by float("0.1") as standing for the Rational number
3602879701896397
/ 36028797018963968. And that loose way of thinking is useful in the
following way:

When you do the computer operation '+' on two bit patterns, you get a new
bit pattern whose notional "number" is within a reasonably small delta of
the number you'd get if you did an operation on Rational numbers. In fact,
the maximum functional form of this delta is provided in the IEEE-754 spec.

But the bit patterns making up floating point "numbers" are not NUMBERS,
and the operations performed on them do not make a FINITE field, let alone
an isomorphism with the infinite field of Rational numbers.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@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/W4NSQ5ZMNXIEZVYH2XPFTIZAME4SXCWY/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to