Against PEP 240

Delaney, Timothy tdelaney at avaya.com
Tue May 29 21:04:09 EDT 2001


> Floating point is what it says floating point. I don't use commas. As
> for being naive; I used to do the most awful assembly code to 
> get extra
> bits out of accelerated tangent series and the like. I know 
> what an ulp
> is, but I don't claim that makes me better than anyone else though. I
> guess like many an old fart I long for the good old days when missiles
> ruled the budgets and 60 bit fp was as good as it got. Moan whine.

Yes, but 7.35 is *not* floating point. It is a decimaly representation of an
exact number. By default, Python currently uses a floating point
*representation* of 7.35, which almost certainly is *not* 7.35 (I can't be
bothered checking).

I would much prefer that the default be for exact representation (not FP,
not BCD, but exact), and to get something else (perhaps as a speed
optimisation) should require additional syntax.

Today's computers are more than fast enough for most uses of exact
representations of rational numbers. There are certainly some uses which
will benefit from the increased speed of FP. There are also some uses which
will benefit from writing in C rather than Python. It's a similar thing -
make the most common usage the easiest. In this case, the most
commonly-required usage is exact representation - floating point causes some
of the most common FAQs in any programming language I have dealt with.
Python has the opportunity to do away with this wart, the wart being that FP
is the default for non-integer numbers.

Tim Delaney




More information about the Python-list mailing list