[Python-Dev] Revamping Python's Numeric Model

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sat, 4 Nov 2000 22:15:13 +0100


> Yes. 1.0 is not an exact number. What's wrong with that?
> (Consider stuff like 0.333333333*3: this shouldn't be exact!)

It's not inherently wrong. It just points out an omission in the PEP:
it doesn't talk about the meaning of number literals. Since the new
model is going to follow algebraic principles more closely, I had
expected that

  0.333333333 == 333333333 / 1000000000

where, as I understand the proposal, the right-hand side is an exact
number (so 0.333333333*3 would be 999999999 / 1000000000).

One of the more-frequent questions on python-help is confusion about
floating-point numbers, e.g. why is the result of 1.99+4.99 printed
as 6.9800000000000004; users often report that as a bug.

Of course, spelling the number you had in mind as inexact(0.333333333)
is hardly acceptable, either.

Regards,
Martin