PEP0238 lament

Moshe Zadka moshez at zadka.site.co.il
Mon Jul 23 06:03:06 CEST 2001


On Sun, 22 Jul 2001 16:27:32 -0700, David Eppstein <eppstein at ics.uci.edu> wrote:
 
> My intuition is that the users who will be surprised that 1/2 = 0 are the 
> same ones who would be bitten by roundoff-error bugs if 1/2 = 0.5.
> Result: buggier code since the errors are less obvious.

The thing is, making 1/2=0.5 won't make the problem *worse*. Because
after two days of being baffled by 1/2=0, these newbies will eventually
figure out the solution float(1)/2. So, I'm just getting to show them
the buggy roundoff-error code *faster*, instead of making them suffer
for it. You want to fix *that* problem, you have to give easy to access
rationals.

> If you have a routine "velocity" in which it doesn't make sense to do 
> integer truncation, and it doesn't coerce its args to float by adding 0.0, 
> that's also a bug.

velocity(1+2j, 3)
-- 
gpg --keyserver keyserver.pgp.com --recv-keys 46D01BD6 54C4E1FE
Secure (inaccessible): 4BD1 7705 EEC0 260A 7F21  4817 C7FC A636 46D0 1BD6
Insecure (accessible): C5A5 A8FA CA39 AB03 10B8  F116 1713 1BCF 54C4 E1FE




More information about the Python-list mailing list